Multicore, multibank, fully concurrent coherence controller

ABSTRACT

A system includes a multi-core shared memory controller (MSMC). The MSMC includes a snoop filter bank, a cache tag bank, and a memory bank. The cache tag bank is connected to both the snoop filter bank and the memory bank. The MSMC further includes a first coherent slave interface connected to a data path that is connected to the snoop filter bank. The MSMC further includes a second coherent slave interface connected to the data path that is connected to the snoop filter bank. The MSMC further includes an external memory master interface connected to the cache tag bank and the memory bank. The system further includes a first processor package connected to the first coherent slave interface and a second processor package connected to the second coherent slave interface. The system further includes an external memory device connected to the external memory master interface.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Application No.62/745,842 filed Oct. 15, 2018, which is hereby incorporated byreference.

BACKGROUND

Multi-core systems provide shared access to one or more memory devices.A core connected to such a system may implement its own data cache whichstores (i.e., “caches”) data from the one or more memory devices as thecore accesses the data so that the core need not send a request out tothe one or more memory devices each time the data is used. In suchsystems multiple processing cores occasionally access the same memoryaddress in the shared memory devices which may lead to coherency issues.For example, if a first core stores cached data from address “Z” of theshared memory devices and modifies the cached data without committingthe modified data back to the shared memory devices, a second corereading from the address “Z” may receive out of date data. Somemulti-core systems provide coherency using software cache maintenanceoperations. However, such operations may lead to operationalinefficiencies (e.g., may be slow or consume excessive amounts ofoperational time). Further, multi-core systems may present additionalchallenges.

SUMMARY

Various systems and methods for providing multi-core coherent systemsare disclosed herein.

In one implementation, a device includes a snoop filter bank, a cachetag bank, and a memory bank. The cache tag bank is connected to both thecache tag bank and the memory bank.

In another implementation, a system includes a multi-core shared memorycontroller (MSMC). The MSMC includes a snoop filter bank, a cache tagbank, and a memory bank. The cache tag bank is connected to both thecache tag bank and the memory bank. The MSMC further includes a firstcoherent slave interface connected to a data path that is connected tothe snoop filter bank. The MSMC further includes a second coherent slaveinterface connected to the data path that is connected to the snoopfilter bank. The MSMC further includes an external memory masterinterface connected to the cache tag bank and the memory bank. Thesystem further includes a first processor package connected to the firstcoherent slave interface and a second processor package connected to thesecond coherent slave interface. The system further includes an externalmemory device connected to the external memory master interface.

In another implementation, a method includes receiving, at a multi-coreshared memory controller (MSMC), a request from a peripheral deviceconnected to the MSMC to access a memory address. The requestcorresponds to a read request or to a write request. The method furtherincludes applying, at the MSMC, a tag associated with the memory addressto a cache tag bank of the MSMC to identify a snoop filter state of thetag stored in a snoop filter bank connected to the cache tag bank and acache hit status of the tag in a memory bank connected to the cache tagbank. The method further includes determining whether to issue a snooprequest to a device connected to the MSMC based on the snoop filterstate and the cache hit status.

A device includes an interconnect and a plurality of devices connectedto the interconnect. The plurality of devices includes a first interfaceconnected to the interconnect and a second interface connected to theinterconnect. The plurality of devices further includes a first memorybank connected to the interconnect and a second memory bank connected tothe interconnect. The plurality of devices further includes an externalmemory interface connected to the interconnect and a controllerconfigured to establish virtual channels among the plurality of devicesconnected to the interconnect.

A system includes a multi-core shared memory controller (MSMC) thatincludes an interconnect and a plurality of devices connected to theinterconnect. The plurality of devices includes a first interfaceconnected to the interconnect and a second interface connected to theinterconnect. The plurality of devices further includes a first memorybank connected to the interconnect and a second memory bank connected tothe interconnect. The plurality of devices further includes an externalmemory interface connected to the interconnect and a controllerconfigured to establish virtual channels among the plurality of devicesconnected to the interconnect. The system further includes a firstprocessor package connected to the first interface and a secondprocessor package connected to the second interface. The system furtherincludes an external memory device connected to the external memoryinterface.

A method includes receiving, at a controller, a message from a firstdevice of a plurality of devices connected to an interconnect. Theplurality of devices include a first interface connected to theinterconnect, a second interface connected to the interconnect, a firstmemory bank connected to the interconnect, a second memory bankconnected to the interconnect, and an external memory interfaceconnected to the interconnect. The method further includes determining,at the controller, a virtual channel associated with a destination ofthe message. The method further includes initiating, at the controller,transmission of the message and an identifier of the virtual channelover the interconnect.

A device includes a data path. The device further includes a firstinterface configured to receive a first memory access request from afirst peripheral device. The device further includes a second interfaceconfigured to receive a second memory access request from a secondperipheral device. The device further includes an arbiter circuitconfigured to determine a first destination device connected to the datapath and associated with the first memory access request and a firstcredit threshold corresponding to the first memory access request. Thearbiter circuit is further configured to determine a second destinationdevice connected to the data path and associated with the second memoryaccess request and a second credit threshold corresponding to the secondmemory access request. The arbiter circuit is further configured toarbitrate access to the data path by the first memory access request andthe second memory access request based on a comparison of the firstcredit threshold to a first number of credits allocated to the firstdestination device and a comparison of the second credit threshold to asecond number of credits allocated to the second destination device.

A system includes a first processor package, a second processor package,and a multi-core shared memory controller (MSMC). The MSMC includes adata path. The MSMC further includes a first interface connected to thefirst processor package and configured to receive a first memory accessrequest from the first processor package. The MSMC further includes asecond interface connected to the second processor package andconfigured to receive a second memory access request from the secondprocessor package. The MSMC further includes an arbiter circuitconfigured to determine a first destination device associated with thefirst memory access request and a first credit threshold correspondingto the first memory access request. The arbiter circuit is furtherconfigured to determine a second destination device associated with thesecond memory access request and a second credit threshold correspondingto the second memory access request. The arbiter circuit is furtherconfigured to arbitrate access to the data path by the first memoryaccess request and the second memory access request based on acomparison of the first credit threshold to a first number of creditsallocated to the first destination device and a comparison of the secondcredit threshold to a second number of credits allocated to the seconddestination device.

A method includes receiving, at an arbitration circuit, a first memoryaccess request from a first processor package connected to a firstinterface. The method further includes receiving, at the arbitrationcircuit, a second memory access request from a second processor packageconnected to a second interface. The method further includesdetermining, at the arbitration circuit, a first destination deviceassociated with the first memory access request and a first creditthreshold corresponding to the first memory access request. The methodfurther includes determining, at the arbitration circuit, a seconddestination device associated with the second memory access request anda second credit threshold corresponding to the second memory accessrequest. The method further includes arbitrating, at the arbitrationcircuit, access to a common data path by the first memory access requestand the second memory access request based on a comparison of the firstcredit threshold to a first number of credits allocated to the firstdestination device and a comparison of the second credit threshold to asecond number of credits allocated to the second destination device.

A device includes a memory bank. The memory bank includes data portionsof a first way group. The data portions of the first way group include adata portion of a first way of the first way group and a data portion ofa second way of the first way group. The memory bank further includesdata portions of a second way group. The device further includes aconfiguration register and a controller configured to individuallyallocate, based on one or more settings in the configuration register,the first way and the second way to one of an addressable memory spaceand a data cache.

A system includes a multi-core shared memory controller (MSMC). The MSMCincludes a processor interface and an external memory interface. TheMSMC further includes a memory bank. The memory bank includes dataportions of a first way group. The data portions of the first way groupinclude a data portion of a first way of the first way group and a dataportion of a second way of the first way group. The memory bank furtherincludes data portions of a second way group. The MSMC further includesa configuration register and a controller configured to individuallyallocate, based on one or more settings in the configuration register,the first way and the second way to one of an addressable memory spaceand a data cache. The system further includes a processor packageconnected to the processor interface and an external memory deviceconnected to the external memory interface.

A method includes receiving, at a controller of a multi-core sharedmemory controller (MSMC), a configuration setting. The MSMC includes amemory bank including data portions of a first way group. The dataportions of the first way group include a data portion of a first way ofthe first way group and a data portion of a second way of the first waygroup. The memory bank further includes data portions of a second waygroup. The method further includes allocating, at the controller, thefirst way and the second way to one of an addressable memory space and adata cache based on the configuration setting.

A device includes a data path. The device further includes a firstinterface connected to the data path and configured to receive a requestfrom a processor package to write a data value to a memory address. Thedevice further includes a controller connected to the data path andconfigured to receive the request to write the data value to the memoryaddress. The controller is further configured to calculate a Hammingcode of the data value. The controller is further configured to transmitthe data value and the Hamming code on the data path. The device furtherincludes an external memory interface. The device further includes anexternal memory interleave connected to the data path and to theexternal memory interface. The external memory interleave is configuredto receive the data value and calculate a test Hamming code of the datavalue. The external memory interleave is further configured to determinewhether to send the data value to the external memory interface to bewritten to the memory address based on a comparison of the Hamming codeand the test Hamming code.

A system includes a processor package, an external memory device, and amulti-core shared memory controller (MSMC). The MSMC includes a datapath and a first interface connected to the data path and the processorpackage. The first interface is configured to receive a request from theprocessor package to write a data value to a memory address of theexternal memory device. The MSMC further includes a controller connectedto the data path and configured to receive the request to write the datavalue to the memory address. The controller is further configured tocalculate a Hamming code of the data value. The controller is furtherconfigured to transmit the data value and the Hamming code on the datapath. The MSMC further includes an external memory interface connectedto the external memory device. The MSMC further includes an externalmemory interleave connected to the data path and to the external memoryinterface. The external memory interleave is configured to receive thedata value and calculate a test Hamming code of the data value. Theexternal memory interleave is further configured to determine whether tosend the data value to the external memory interface to be written tothe memory address based on a comparison of the Hamming code and thetest Hamming code.

A method includes receiving, at a controller of a multi-core sharedmemory controller (MSMC), a request to write a data value to a memoryaddress of an external memory device connected to the MSMC. The methodfurther includes calculating, a Hamming code of the data value. Themethod further includes transmitting the data value and the Hamming codeto an external memory interleave of the MSMC on a common data pathconnected to components of the MSMC. The method further includesdetermining, at the external memory interleave, a test Hamming codebased on the data value. The method further includes determining whetherto send the data value to the external memory device based on acomparison of the test Hamming code and the Hamming code.

A device includes a data path. The device further includes a firstinterface configured to receive a first memory access request from afirst peripheral device and a second interface configured to receive asecond memory access request from a second peripheral device. The devicefurther includes an arbiter circuit configured to, in a first clockcycle determine a first destination device connected to the data pathand associated with the first memory access request and a first creditthreshold corresponding to the first memory access request. The arbitercircuit is further configured to, in the first clock cycle, determine asecond destination device connected to the data path and associated withthe second memory access request and a second credit thresholdcorresponding to the second memory access request. The arbiter circuitis further configured to, in the first clock cycle, select apre-arbitration winner between the first memory access request and thesecond memory access request based on a comparison of the first creditthreshold to a first number of credits allocated to the firstdestination device and a comparison of the second credit threshold to asecond number of credits allocated to the second destination device. Thearbiter circuit is further configured to, in a second clock cycle selecta final arbitration winner from among the pre-arbitration winner and asubsequent memory access request based on a comparison of a priority ofthe pre-arbitration winner and a priority of the subsequent memoryaccess request. The arbiter circuit is further configured to drive thefinal arbitration winner to the data path.

A system includes a first processor package, a second processor package,and a multi-core shared memory controller (MSMC). The MSMC includes adata path. The MSMC further includes a first interface connected to thefirst processor package and configured to receive a first memory accessrequest from the first processor package and a second interfaceconnected to the second processor package and configured to receive asecond memory access request from the second processor package. The MSMCfurther includes an arbiter circuit configured to, in a first clockcycle, determine a first destination device connected to the data pathand associated with the first memory access request and a first creditthreshold corresponding to the first memory access request. The arbitercircuit is further configured to, in the first clock cycle, determine asecond destination device connected to the data path and associated withthe second memory access request and a second credit thresholdcorresponding to the second memory access request. The arbiter circuitis further configured to, in the first clock cycle, select apre-arbitration winner between the first memory access request and thesecond memory access request based on a comparison of the first creditthreshold to a first number of credits allocated to the firstdestination device and a comparison of the second credit threshold to asecond number of credits allocated to the second destination device. Thearbiter circuit is further configured to in a second clock cycle, selecta final arbitration winner from among the pre-arbitration winner and asubsequent memory access request based on a comparison of a priority ofthe pre-arbitration winner and a priority of the subsequent memoryaccess request and drive the final arbitration winner to the data path.

A method includes receiving, at an arbitration circuit, a first memoryaccess request from a first processor package connected to a firstinterface. The method further includes receiving, at the arbitrationcircuit, a second memory access request from a second processor packageconnected to a second interface. The method further includes, in a firstclock cycle, determining, at the arbitration circuit, a firstdestination device associated with the first memory access request and afirst credit threshold corresponding to the first memory access request.The method further includes, in the first clock cycle, determining, atthe arbitration circuit, a second destination device associated with thesecond memory access request and a second credit threshold correspondingto the second memory access request. The method further includes, in thefirst clock cycle, selecting a pre-arbitration winner between the firstmemory access request and the second memory access request based on acomparison of the first credit threshold to a first number of creditsallocated to the first destination device and a comparison of the secondcredit threshold to a second number of credits allocated to the seconddestination device. The method further includes, in a second clockcycle, selecting a final arbitration winner from among thepre-arbitration winner and a subsequent memory access request based on acomparison of a priority of the pre-arbitration winner and a priority ofthe subsequent memory access request and driving the final arbitrationwinner to the data path.

A device includes an arbiter circuit configured to receive a firstrequest for a resource. The first request is associated with a firstcredit cost. The arbiter circuit is further configured to receive asecond request for the resource. The second request is associated with asecond credit cost. The arbiter circuit is further configured to selectthe first request for the resource as an arbitration winner. The arbitercircuit is further configured to decrement a number of available creditsassociated with the resource by the first credit cost. The arbitercircuit is further configured to, in response to the number of availablecredits associated with the resource falling to a lower creditthreshold, wait until the number of available credits associated withthe resource reaches an upper credit threshold to select an additionalarbitration winner for the resource.

A system includes a first processor package, a second processor package,an external memory device; and a multi-core shared memory controller(MSMC). The MSMC includes a first interface connected to the firstprocessor package and a second interface connected to the secondprocessor package. The MSMC further includes an external memoryinterface connected to the external memory device and an arbiter circuitconfigured to receive a first memory access request from the firstprocessor package for the external memory device. The first memoryaccess request associated with a first credit cost. The arbiter circuitis further configured to receive a second memory access request from thesecond processor package for the external memory device. The secondmemory access request associated with a second credit cost. The arbitercircuit is further configured to select the first memory access requestas an arbitration winner and decrement a number of available creditsassociated with the external memory device by the first credit cost. Thearbiter circuit is further configured to, in response to the number ofavailable credits associated with the external memory device falling toa lower credit threshold, wait until the number of available creditsassociated with the external memory device reaches an upper creditthreshold to select an additional arbitration winner for the externalmemory device.

A method includes receiving a first request for a resource. The firstrequest is associated with a first credit cost. The method furtherincludes receiving a second request for the resource. The second requestis associated with a second credit cost. The method further includesselecting the first request for the resource as an arbitration winnerand decrementing a number of available credits associated with theresource by the first credit cost. The method further includes inresponse to the number of available credits associated with the resourcefalling to a lower credit threshold, waiting until the number ofavailable credits associated with the resource reaches an upper creditthreshold to select an additional arbitration winner for the resource.

BRIEF DESCRIPTION OF THE DRAWINGS

For a detailed description of various examples, reference will now bemade to the accompanying drawings in which:

FIG. 1 illustrates a multi-core processing system, in accordance withaspects of the present disclosure.

FIG. 2 is a functional block diagram of a MSMC, in accordance withaspects of the present disclosure.

FIG. 3 is a block diagram of a DRU, in accordance with aspects of thepresent disclosure.

FIG. 4 is a block diagram of a MSMC bridge.

FIG. 5 is a flow diagram illustrating a technique for accessing memoryby a memory controller, in accordance with aspects of the presentdisclosure.

FIG. 6 is a table illustrating data stored by snoop filter banks, cachetag banks, and random access memory (RAM) banks.

FIG. 7 is a table illustrating conditions under which a coherencycontroller issues snoop requests and accesses various memory devices.

FIG. 8 is a flowchart illustrating a method of processing memory accessrequests.

FIG. 9 is a diagram illustrating read-modify-write queues included inthe MSMC.

FIG. 10 is a diagram illustrating asymmetrical interleaving of memoryspaces to form an external memory address range accessible to devicesconnected to the MSMC.

FIG. 11 is a diagram illustrating symmetrical interleaving of memoryspaces to form an external memory address range accessible to devicesconnected to the MSMC.

FIG. 12 is a diagram of a MSMC configuration module.

FIG. 13 is a diagram of ways allocated between different groups ofmaster peripherals.

FIG. 14 is a diagram of circuitry for controlling cache tag allocation.

FIG. 15 is a diagram illustrating that data portions of ways within theMSMC may be allocated between addressable storage space and cache space.

FIG. 16 depicts examples of different allocations of way data portionsbetween cache and addressable storage space.

FIG. 17 depicts an example of data portions of all ways allocated toaddressable storage space.

FIG. 18 is a flowchart of a method of transmitting messages on a sharedinterconnect.

FIG. 19 is a flowchart of a method of arbitrating access to a commondata path.

FIG. 20 is a flowchart of a method of allocating ways betweenaddressable storage space and data cache space.

FIG. 21 is a flowchart of a method of protecting data within the MSMC.

FIG. 22 is a flowchart of a method of performing two-step arbitration ofaccess to a common data path.

FIG. 23 is a method of hiding credits during credit based arbitration.

DETAILED DESCRIPTION

Specific embodiments of the invention will now be described in detailwith reference to the accompanying figures. In the following detaileddescription of embodiments of the invention, numerous specific detailsare set forth in order to provide a more thorough understanding of theinvention. However, it will be apparent to one of ordinary skill in theart that the invention may be practiced without these specific details.In other instances, well-known features have not been described indetail to avoid unnecessarily complicating the description.

High performance computing has taken on even greater importance with theadvent of the Internet and cloud computing. To ensure the responsivenessof networks, online processing nodes and storage systems must haveextremely robust processing capabilities and exceedingly fastdata-throughput rates. Robotics, medical imaging systems, visualinspection systems, electronic test equipment, and high-performancewireless and communication systems, for example, must be able to processan extremely large volume of data with a high degree of precision. Amulti-core architecture that embodies an aspect of the present inventionwill be described herein. In a typically embodiment, a multi-core systemis implemented as a single system on chip (SoC).

FIG. 1 is a functional block diagram of a multi-core processing system100, in accordance with aspects of the present disclosure. System 100 isa multi-core SoC that includes a processing cluster 102 including one ormore processor packages 104. The one or more processor packages 104 mayinclude one or more types of processors, such as a central processorunit (CPU), graphics processor unit (GPU), digital signal processor(DSP), etc. As an example, a processing cluster 102 may include a set ofprocessor packages split between DSP, CPU, and GPU processor packages.Each processor package 104 may include one or more processing cores. Asused herein, the term “core” refers to a processing module that maycontain an instruction processor, such as a DSP or other type ofmicroprocessor. Each processor package also contains one or more caches108. These caches 108 may include one or more level one (L1) caches, andone or more level two (L2) cache. For example, a processor package 104may include four cores, each core including an L1 data cache and L1instruction cache, along with a L2 cache shared by the four cores.

The multi-core processing system 100 also includes a multi-core sharedmemory controller (MSMC) 110, through which is connected one or moreexternal memories 114 and direct memory access/input/output (DMA/IO)clients 116. The MSMC 110 also includes an on-chip internal memory 112system which is directly managed by the MSMC 110. In certainembodiments, the MSMC 110 helps manage traffic between multipleprocessor cores, other mastering peripherals or direct memory access(DMA) and allows processor packages 104 to dynamically share theinternal and external memories for both program instructions and data.The MSMC internal memory 112 offers flexibility to programmers byallowing portions to be configured as shared level-2 (SL2) random accessmemory (RAM) or shared level-3 (SL3) RAM. External memory 114 may beconnected through the MSMC 110 along with the internal shared memory 112via a memory interface (not shown), rather than to chip systeminterconnect as has traditionally been done on embedded processorarchitectures, providing a fast path for software execution. In thisembodiment, external memory may be treated as SL3 memory and thereforecacheable in L1 and L2 (e.g., the caches 108).

FIG. 2 is a functional block diagram of a MSMC 200, in accordance withaspects of the present disclosure. The MSMC 200 may correspond to theMSMC 110 of FIG. 1. The MSMC 200 includes a MSMC core 202 defining theprimary logic circuits of the MSMC. The MSMC 200 is configured toprovide an interconnect between master peripherals (e.g., devices thataccess memory, such as processors, direct memory access/input outputdevices, etc.) and slave peripherals (e.g., memory devices, such asdouble data rate random access memory, other types of random accessmemory, direct memory access/input output devices, etc.). Masterperipherals connected to the MSMC 200 may include, for example, theprocessor packages 104 of FIG. 1. The master peripherals may or may notinclude caches. The MSMC 200 is configured to provide hardware basedmemory coherency between master peripherals connected to the MSMC 200even in cases in which the master peripherals include their own caches.The MSMC 200 may further provide a coherent level 3 cache accessible tothe master peripherals and/or additional memory space (e.g., scratch padmemory) accessible to the master peripherals.

The MSMC core 202 includes a plurality of coherent slave interfaces206A-D. While in the illustrated example, the MSMC core 202 includesthirteen coherent slave interfaces 206 (only four are shown forconciseness), other implementations of the MSMC core 202 may include adifferent number of coherent slave interfaces 206. Each of the coherentslave interfaces 206A-D is configured to connect to one or morecorresponding master peripherals (e.g., one of the processor packages104 of FIG. 1). Example master peripherals include a processor, aprocessor package, a direct memory access device, an input/outputdevice, etc. Each of the coherent slave interfaces 206 is configured totransmit data and instructions between the corresponding masterperipheral and the MSMC core 202. For example, the first coherent slaveinterface 206A may receive a read request from a master peripheralconnected to the first coherent slave interface 206A and relay the readrequest to other components of the MSMC core 202. Further, the firstcoherent slave interface 206A may transmit a response to the readrequest from the MSMC core 202 to the master peripheral. In someimplementations, the coherent slave interfaces 206 correspond to 512 bitor 256 bit interfaces and support 48 bit physical addressing of memorylocations.

In the illustrated example, a thirteenth coherent slave interface 206Dis connected to a common bus architecture (CBA) system on chip (SOC)switch 208. The CBA SOC switch 208 may be connected to a plurality ofmaster peripherals and be configured to provide a switched connectionbetween the plurality of master peripherals and the MSMC core 202. Whilenot illustrated, additional ones of the coherent slave interfaces 206may be connected to a corresponding CBA. Alternatively, in someimplementations, none of the coherent slave interfaces 206 is connectedto a CBA SOC switch.

In some implementations, one or more of the coherent slave interfaces206 interfaces with the corresponding master peripheral through a MSMCbridge 210 configured to provide one or more translation servicesbetween the master peripheral connected to the MSMC bridge 210 and theMSMC core 202. For example, ARM v7 and v8 devices utilizing the AXI/ACEand/or the Skyros protocols may be connected to the MSMC 200, while theMSMC core 202 may be configured to operate according to a coherencestreaming credit-based protocol, such as Multi-core bus architecture(MBA). The MSMC bridge 210 helps convert between the various protocols,to provide bus width conversion, clock conversion, voltage conversion,or a combination thereof. In addition, or in the alternative to suchtranslation services, the MSMC bridge 210 may provide cache prewarmingsupport via an Accelerator Coherency Port (ACP) interface for accessinga cache memory of a coupled master peripheral and data error correctingcode (ECC) detection and generation. In the illustrated example, thefirst coherent slave interface 206A is connected to a first MSMC bridge210A and an eleventh coherent slave interface 206B is connected to asecond MSMC bridge 210B. In other examples, more or fewer (e.g., 0) ofthe coherent slave interfaces 206 are connected to a corresponding MSMCbridge.

The MSMC core 202 includes an arbitration and data path manager 204. Thearbitration and data path manager 204 includes a data path 262 (e.g., aninterconnect), such as a collection of wires, traces, other conductiveelements, etc., between the coherent slave interfaces 206 and othercomponents of the MSMC core 202. For example, the data path 262 maycorrespond to a bus. Each of the components of the MSMC core 202 isconfigured to communicate over the data path 262 (e.g., over the samephysical connections). The arbitration and data path manager 204includes an arbiter circuit 260 that includes logic configured toestablish virtual channels between components of the MSMC 200 over theshared data path 262. In addition, the arbiter circuit 260 is configuredto arbitrate access to these virtual channels over the shared data path262 (e.g., the shared physical connections). Using virtual channels overthe shared data path 262 within the MSMC 200 may reduce a number ofconnections and an amount of wiring used within the MSMC 200 as comparedto implementations that rely on a crossbar switch for connectivitybetween components. In some implementations, the arbitration and datapath manager 204 includes hardware logic configured to perform thearbitration operations described herein. In alternative examples, thearbitration and data path manager 204 includes a processing deviceconfigured to execute instructions (e.g., stored in a memory of thearbitration and data path manager 204) to perform the arbitrationoperations described herein. As described further herein, additionalcomponents of the MSMC 200 may include arbitration logic (e.g., hardwareconfigured to perform arbitration operations, a processor configure toexecute arbitration instructions, or a combination thereof). Thearbitration and data path manager 204 may select an arbitration winnerto place on the shared physical connections from among a plurality ofrequests (e.g., read requests, write requests, snoop requests, etc.)based on a priority level associated with a requestor, based on afair-share or round robin fairness level, based on a starvationindicator, or a combination thereof.

The arbitration and data path manager 204 further includes a coherencycontroller 224. The coherency controller 224 includes snoop filter banks212. The snoop filter banks 212 are hardware units that storeinformation indicating which (if any) of the master peripherals storesdata associated with lines of memory of memory devices connected to theMSMC 200. The coherency controller 224 is configured to maintaincoherency of shared memory based on contents of the snoop filter banks212.

The MSMC 200 further includes a MSMC configuration module 214 connectedto the arbitration and data path manager 204. The MSMC configurationmodule 214 stores various configuration settings associated with theMSMC 200. In some implementations, the MSMC configuration module 214includes additional arbitration logic (e.g., hardware arbitration logic,a processor configured to execute software arbitration logic, or acombination thereof).

The MSMC 200 further includes a plurality of cache tag banks 216. In theillustrated example, the MSMC 200 includes four cache tag banks 216A-D.In other implementations, the MSMC 200 includes a different number ofcache tag banks 216 (e.g., 1 or more). In a particular example, the MSMC200 includes eight cache tag banks 216. The cache tag banks 216 areconnected to the arbitration and data path manager 204. Each of thecache tag banks 216 is configured to store “tags” indicating memorylocations in memory devices connected to the MSMC 200. Each entry in thesnoop filter banks 212 corresponds to a corresponding one of the tags inthe cache tag banks 216. Thus, each entry in the snoop filter indicateswhether data associated with a particular memory location is stored inone of the master peripherals.

Each of the cache tag banks 216 is connected to a corresponding RAM bank218 and to a corresponding snoop filter bank 212. For example, a firstcache tag bank 216A is connected to a first RAM bank 218A and to a firstsnoop filter bank 212A, etc. Each entry in the RAM banks 218 isassociated with a corresponding entry in the cache tag banks 216 and acorresponding entry in the snoop filter banks 212. The RAM banks 218 maycorrespond to the internal memory 112 of FIG. 1. Entries in the RAMbanks 218 may be used as an additional cache or as additional memoryspace based on a setting stored in the MSMC configuration module 214.The cache tag banks 216 and the RAM banks 218 may correspond to RAMmodules (e.g., static RAM). While not illustrated in FIG. 2, the MSMC200 may include read modify write queues connected to each of the RAMbanks 218. These read modify write queues may include arbitration logic,buffers, or a combination thereof. Each snoop filter bank 212-cache tagbank 216-RAM bank 218 grouping may receive input and generate output inparallel.

The MSMC 200 further includes an external memory interleave 220connected to the cache tag banks 216 and the RAM banks 218. One or moreexternal memory master interfaces 222 are connected to the externalmemory interleave 220. The external memory master interfaces 222 areconfigured to connect to external memory devices (e.g., double data ratedevices, DMA/IO devices, etc.) and to exchange messages between theexternal memory devices and the MSMC 200. The external memory devicesmay include, for example, the external memories 114 of FIG. 1, theDMA/IO clients 116, of FIG. 1, or a combination thereof. The externalmemory interleave 220 is configured to interleave or separate addressspaces assigned to the external memory master interfaces 222. While twoexternal memory master interfaces 222A-B are shown, otherimplementations of the MSMC 200 may include a different number ofexternal memory master interfaces 222. In some implementations, theexternal memory master interfaces 222 support 48-bit physical addressingfor connected memory devices.

The MSMC 200 also includes a data routing unit (DRU) 250, which helpsprovide integrated address translation and cache prewarmingfunctionality and is coupled to a packet streaming interface link(PSI-L) interface 252, which is a system wide bus supporting DMA controlmessaging. The DRU 250 includes a memory management unit (MMU) 254. TheMMU 254 is configured to translation between virtual and physicaladdresses. The MMU 254 may store translations between the virtualaddresses and the physical addresses in a translation lookaside buffer,a micro translation lookaside buffer, or some other device within theMMU 254.

DMA control messaging may be used by applications to perform memoryoperations, such as copy or fill operations, in an attempt to reduce thelatency time needed to access that memory. Additionally, DMA controlmessaging may be used to offload memory management tasks from aprocessor. However, traditional DMA controls have been limited to usingphysical addresses rather than virtual memory addresses. Virtualizedmemory allows applications to access memory using a set of virtualmemory addresses without having to have any knowledge of the physicalmemory addresses. An abstraction layer handles translating between thevirtual memory addresses and physical addresses. Typically, thisabstraction layer is accessed by application software via a supervisorprivileged space. For example, an application having a virtual addressfor a memory location and seeking to send a DMA control message mayfirst make a request into a privileged process, such as an operatingsystem kernel requesting a translation between the virtual address to aphysical address prior to sending the DMA control message. In caseswhere the memory operation crosses memory pages, the application mayhave to make separate translation requests for each memory page.Additionally, when a task first starts, memory caches for a processormay be “cold” as no data has yet been accessed from memory and thesecaches have not yet been filled. The costs for the initial memory filland abstraction layer translations can bottleneck certain tasks, such assmall to medium sized tasks which access large amounts of memory.Improvements to DMA control message operations may help improve thesebottlenecks.

In operation, the MSMC 200 receives a memory access request (e.g., readrequest, write request, etc.) from a master peripheral connected to thecoherent slave interfaces 206. The memory access request indicates amemory address, which may be a virtual memory address or physical memoryaddress within an external memory device connected to the externalmemory master interfaces 222 or within of one of the RAM banks 218. Thememory access request is received by the arbitration and data pathmanager 204. The coherency controller may transmit a virtual memoryaddress to the MMU 254 to obtain a physical memory address translation.Accordingly, the MSMC 200 may provide for coherency between masterperipherals utilizing different virtual address spaces to access sharedmemory. Once the coherency controller 224 obtains a physical memoryaddress, the coherency controller determines a tag associated with thephysical memory address (e.g., by masking out one or more leastsignificant bits of the physical memory addresses). The coherencycontroller 224 determines whether the cache provided by the RAM banks218 stores a value for the tag and whether the master peripherals storea cached value for the tag by applying the tag to the cache tag banks216 and checking output of the corresponding RAM banks 218 and snoopfilter banks 212. Based on a type of the memory access request, a snoopstate associated with the tag output by the snoop filter banks 212, anda cache status associated with the tag within the RAM banks 218, thecoherency controller determines whether to issue snoop requests to oneor more of the master peripherals connected to the coherent slaveinterfaces and whether to utilize a cached value and/or to directlyaccess the physical address to respond to memory access request asdescribed further herein.

The coherency controller 224 enforces memory access coherency bysequencing accesses to a particular physical address based on time ofreceipt and by ensuring that a most up-to-date value for the physicaladdress is used to respond to a memory access request even in instancesin which the most up-to-date value is stored in a cache of one of themaster peripherals connected to the coherent slave interfaces 206.Because snoop filter banks 212 and RAM banks 218 share common cache tagbanks 216, the MSMC 200 may provide caching and coherency functionalityand a shared cache functionality using fewer components and utilizing asmaller footprint as compared to a device that utilizes separate cachetag banks for RAM banks and snoop filter banks. Further, the coherencycontroller 224, snoop filter banks 212, cache tag banks 216, and RAMbanks 218 are used to enforce coherency of accesses to both externalmemories connected to the external memory master interfaces 222 and tothe RAM banks 218. For this additional reason, the MSMC 200 may utilizefewer components and have a smaller footprint as compared to anotherdevice. In addition, because the snoop filter banks 212 are implementedin hardware rather than software, the coherency controller 224 mayutilize fewer clock cycles to provide coherency as compared to softwarebased implementations.

FIG. 3 is a block diagram of a DRU 300, in accordance with aspects ofthe present disclosure. In some implementations, the DRU 300 correspondsto the DRU 250 of FIG. 2. The DRU 300 can operate on two general memoryaccess commands, a transfer request (TR) command to move data from asource location to a destination location, and a cache request (CR)command to send messages to a specified cache controller or memorymanagement units (MMUs) to prepare the cache for future operations byloading data into memory caches which are operationally closer to theprocessor cores, such as a L1 or L2 cache, as compared to main memory oranother cache that may be organizationally separated from the processorcores. The DRU 300 may receive these commands via one or moreinterfaces. In this example, two interfaces are provided, a direct writeof a memory mapped register (MMR) 302 and via a PSI-L message 304 via aPSI-L interface 344 to a PSI-L bus. In certain cases, the memory accesscommand and the interface used to provide the memory access command mayindicate the memory access command type, which may be used to determinehow a response to the memory access command is provided.

The PSI-L bus may be a system bus that provides for DMA access andevents across the multi-core processing system, as well as for connectedperipherals outside of the multi-core processing system, such as powermanagement controllers, security controllers, etc. The PSI-L interface344 connects the DRU 300 with the PSI-L bus of the processing system. Incertain cases, the PSI-L may carry messages and events. PSI-L messagesmay be directed from one component of the processing system to another,for example from an entity, such as an application, peripheral,processor, etc., to the DRU. In certain cases, sent PSI-L messagesreceive a response. PSI-L events may be placed on and distributed by thePSI-L bus by one or more components of the processing system. One ormore other components on the PSI-L bus may be configured to receive theevent and act on the event. In certain cases, PSI-L events do notrequire a response.

The PSI-L message 304 may include a TR command. The PSI-L message 304may be received by the DRU 300 and checked for validity. If the TRcommand fails a validity check, a channel ownership check, or transferbuffer 306 fullness check, a TR error response may be sent back byplacing a return status message 308, including the error message, in theresponse buffer 310. If the TR command is accepted, then anacknowledgement may be sent in the return status message. In certaincases, the response buffer 310 may be a first in, first out (FIFO)buffer. The return status message 308 may be formatted as a PSI-Lmessage by the data formatter 312 and the resulting PSI-L message 342sent, via the PSI-L interface 344, to a requesting entity which sent theTR command.

A relatively low-overhead way of submitting a TR command, as compared tosubmitting a TR command via a PSI-L message, may also be provided usingthe MMR 302. According to certain aspects, a core of the multi-coresystem may submit a TR request by writing the TR request to the MMRcircuit 302. The MMR may be a register of the DRU 300. In certain cases,the MSMC may include a set of registers and/or memory ranges which maybe associated with the DRU 300, such as one or more registers in theMSMC configuration module 214. When an entity writes data to thisassociated memory range, the data is copied to the MMR 302 and passedinto the transfer buffer 306. The transfer buffer 306 may be a FIFObuffer into which TR commands may be queued for execution. In certaincases, the TR request may apply to any memory accessible to the DRU 300,allowing the core to perform cache maintenance operations across themulti-core system, including for other cores.

The MMR 302, in certain embodiments, may include two sets of registers,an atomic submission register and a non-atomic submission register. Theatomic submission register accepts a single 64 byte TR command, checksthe values of the burst are valid values, pushes the TR command into thetransfer buffer 306 for processing, and writes a return status message308 for the TR command to the response buffer 310 for output as a PSI-Levent. In certain cases, the MMR 302 may be used to submit TR commandsbut may not support messaging the results of the TR command and anindication of the result of the TR command submitted by the MMR 302 maybe output as a PSI-L event, as discussed above.

The non-atomic submission register provides a set of register fields(e.g., bits or designated set of bits) which may be written into overmultiple cycles rather than in a single burst. When one or more fieldsof the register, such as a type field, is set, the contents of thenon-atomic submission register may be checked and pushed into thetransfer buffer 306 for processing and an indication of the result ofthe TR command submitted by the MMR 302 may be output as a PSI-L event,as discussed above.

Commands for the DRU may also be issued based on one or more eventsreceived at one or more trigger control channels 316A-316X. In certaincases, multiple trigger control channels 316A-316X may be used inparallel on common hardware and the trigger control channels 316A-316Xmay be independently triggered by received local events 318A-318X and/orPSI-L global events 320A-320X. In certain cases, local events 318A-318Xmay be events sent from within a local subsystem controlled by the DRUand local events may be triggered by setting one or more bits in a localevents bus 346. PSI-L global events 320A-320X may be triggered via aPSI-L event received via the PSI-L interface 344. When a trigger controlchannel is triggered, local events 348A-348X may be output to the localevents bus 346.

Each trigger control channel may be configured, prior to use, to beresponsive to (e.g., triggered by) a particular event, either aparticular local event or a particular PSI-L global event. In certaincases, the trigger control channels 316A-316X may be controlled inmultiple parts, for example, via a non-realtime configuration, intendedto be controlled by a single master, and a realtime configurationcontrolled by a software process that owns the trigger control channel.Control of the trigger control channels 316A-316X may be set up via oneor more received channel configuration commands.

Non-realtime configuration may be performed, for example, by a singlemaster, such as a privileged process, such as a kernel application. Thesingle master may receive a request to configure a trigger controlchannel from an entity. The single master then initiates a non-realtimeconfiguration via MMR writes to particular region of channelconfiguration registers 322, where regions of the channel configurationregisters 322 correlate to a particular trigger control channel beingconfigured. The configuration includes fields which allow the particulartrigger control channel to be assigned, an interface to use to obtainthe TR command, such as via the MMR 302 or PSI-L message 304, whichqueue of one or more queues 330 a triggered TR command should be sentto, and one or more events to output on the PSI-L bus after the TRcommand is triggered. The trigger control channel being configured thenobtains the TR command from the assigned interface and stores the TRcommand. In certain cases, the TR command includes triggeringinformation. The triggering information indicates to the trigger controlchannel what events the trigger control is responsive to (e.g.triggering events). These events may be particular local events internalto the memory controller or global events received via the PSI-Linterface 344. Once the non-realtime configuration is performed for theparticular channel, a realtime configuration register of the channelconfiguration registers 322 may be written by the single master toenable the trigger control channel. In certain cases, a trigger controlchannel can be configured with one or more triggers. The triggers can bea local event, or a PSI-L global event. Realtime configuration may alsobe used to pause or teardown the trigger control channel.

Once a trigger control channel is activated, the channel waits until theappropriate trigger is received. For example, a peripheral may configurea particular trigger control channel, in this example trigger controlchannel 316B, to respond to PSI-L events and, after activation of thetrigger control channel 316B, the peripheral may send a triggering PSI-Levent 320B to the trigger control channel 316B. Once triggered, the TRcommand is sent by the trigger control channels 316A-316X. The sent TRcommands are arbitrated by the channel arbitrator 324 for translation bythe subtiler 326 into an op code operation addressed to the appropriatememory. In certain cases, the arbitration is based on a fixed priorityassociated with the channel and a round robin queue arbitration may beused for queue arbitration to determine the winning active triggercontrol channel. In certain cases, a particular trigger control channel,such as trigger control channel 316B, may be configured to send arequest for a single op code operation and the trigger control channelcannot send another request until the previous request has beenprocessed by the subtiler 326.

In accordance with aspects of the present disclosure, the subtiler 326includes a memory management unit (MMU) 328. In some implementations,the MMU 328 corresponds to the MMU 254 of FIG. 2. The MMU 328 helpstranslate virtual memory addresses to physical memory addresses for thevarious memories that the DRU can address, for example, using a set ofpage tables to map virtual page numbers to physical page numbers. Incertain cases, the MMU 328 may include multiple fully associative microtranslation lookaside buffers (uTLBs) which are accessible and softwaremanageable, along with one or more associative translation lookasidebuffers (TLBs) caches for caching system page translations. In use, anentity, such as an application, peripheral, processor, etc., may bepermitted to access a particular virtual address range for caching dataassociated with the application. The entity may then issue DMA requests,for example via TR commands, to perform actions on virtual memoryaddresses within the virtual address range without having to firsttranslate the virtual memory addresses to physical memory addresses. Asthe entity can issue DMA requests using virtual memory addresses, theentity may be able to avoid calling a supervisor process or otherabstraction layer to first translate the virtual memory addresses.Rather, virtual memory addresses in a TR command, received from theentity, are translated by the MMU to physical memory addresses. The MMU328 may be able to translate virtual memory addresses to physical memoryaddresses for each memory the DRU can access, including, for example,internal and external memory of the MSMC, along with L2 caches for theprocessor packages.

In certain cases, the DRU can have multiple queues and perform one reador one write to a memory at a time. Arbitration of the queues may beused to determine an order in which the TR commands may be issued. Thesubtiler 326 takes the winning trigger control channel and generates oneor more op code operations using the translated physical memoryaddresses, by, for example, breaking up a larger TR into a set ofsmaller transactions. The subtiler 326 pushes the op code operationsinto one or more queues 330 based, for example, on an indication in theTR command on which queue the TR command should be placed. In certaincases, the one or more queues 330 may include multiple types of queueswhich operate independently of each other. In this example, the one ormore queues 330 include one or more priority queues 332A-332B and one ormore round robin queues 334A-334C. The DRU may be configured to givepriority to the one or more priority queues 332A-332B. For example, thepriority queues may be configured such that priority queue 332A has ahigher priority than priority queue 332B, which would in turn have ahigher priority than another priority queue (not shown). The one or morepriority queues 332A-332B (and any other priority queues) may all havepriority over the one or more round robin queues 334A-334C. In certaincases, the TR command may specify a fixed priority value for the commandassociated with a particular priority queue and the subtiler 326 mayplace those TR commands (and associated op code operations) into therespective priority queue. Each queue may also be configured so that anumber of consecutive commands that may be placed into the queue. As anexample, priority queue 332A may be configured to accept fourconsecutive commands. If the subtiler 326 has five op code operationswith fixed priority values associated with priority queue 332A, thesubtiler 326 may place four of the op code operations into the priorityqueue 332A. The subtiler 326 may then stop issuing commands until atleast one of the other TR commands is cleared from priority queue 332A.Then the subtiler 326 may place the fifth op code operation intopriority queue 332A. A priority arbitrator 336 performs arbitration asto the priority queues 332A-332B based on the priority associated withthe individual priority queues.

As the one or more priority queues 332A-332B have priority over theround robin queues 334A-334C, once the one or more priority queues332A-332B are empty, the round robin queues 334A-334C are arbitrated ina round robin fashion, for example, such that each round robin queue maysend a specified number of transactions through before the next roundrobin queue is selected to send the specified number of transactions.Thus, each time arbitration is performed by the round robin arbitrator338 for the one or more round robin queues 334A-334C, the round robinqueue below the current round robin queue will be the highest priorityand the current round robin queue will be the lowest priority. If an opcode operation gets placed into a priority queue, the priority queue isselected, and the current round robin queue retains the highest priorityof the round robin queues. Once an op code operation is selected fromthe one or more queues 330, the op code operation is output via anoutput bus 340 to the MSMC central arbitrator (e.g., the arbitration anddata path manager 204 of FIG. 2) for output to the respective memory.

In cases where the TR command is a read TR command (e.g., a TR whichreads data from the memory), once the requested read is performed by thememory, the requested block of data is received in a return statusmessage 308, which is pushed onto the response buffer 310. The responseis then formatted by the data formatter 312 for output. The dataformatter 312 may interface with multiple busses for outputting, basedon the information to be output. For example, if the TR includesmultiple loops to load data and specifies a particular loop in which tosend an event associated with the TR after the second loop, the dataformatter 312 may count the returns from the loops and output the eventafter the second loop result is received.

In certain cases, write TR commands may be performed after a previousread command has been completed and a response received. If a write TRcommand is preceded by a read TR command, arbitration may skip the writeTR command or stop if a response to the read TR command has not beenreceived. A write TR may be broken up into multiple write op codeoperations and these multiple write op code operations may be output tothe MSMC central arbitrator (e.g., the arbitration and data path manager204 of FIG. 2) for transmission to the appropriate memory prior togenerating a write completion message. Once all the responses to themultiple write op code operations are received, the write completionmessage may be output.

In addition to TR commands, the DRU may also support CR commands. Incertain cases, CR commands may be a type of TR command and may be usedto place data into an appropriate memory or cache closer to a core thanmain memory prior to the data being needed. By preloading the data, whenthe data is needed by the core, the core is able to find the data in thememory or cache quickly without having to request the data from, forexample, main memory or persistent storage. As an example, if an entityknows that a core will soon need data that is not currently cached(e.g., data not used previously, just acquired data, etc.), the entitymay issue a CR command to prewarm a cache associated with the core. ThisCR command may be targeted to the same core or another core. Forexample, the CR command may write data into a L2 cache of a processorpackage that is shared among the cores of the processor package.

In accordance with aspects of the present disclosure, how a CR commandis passed to the target memory varies based on the memory or cache beingtargeted. As an example, a received CR command may target an L2 cache ofa processor package. The subtiler 326 may translate the CR command to aread op code operation. The read op code operation may include anindication that the read op code operation is a prewarming operation andis passed, via the output bus 340 to the MSMC. Based on the indicationthat the read op code is a prewarming operation, the MSMC routes theread op code operation to the memory controller of the appropriatememory. By issuing a read op code to the memory controller, the memorycontroller may attempt to load the requested data into the L2 cache tofulfill the read. Once the requested data is stored in the L2 cache, thememory controller may send a return message indicating that the load wassuccessful to the MSMC. This message may be received by the responsebuffer 310 and may be output at PSI-L output 342 as a PSI-L event. Asanother example, the subtiler 326, in conjunction with the MMU 328, mayattempt to prewarm an L3 cache. The subtiler 326 may format the CRcommand to the L3 cache as a cache read op code and pass the cache read,via the output bus 340 and the MSMC, to the L3 cache memory itself. TheL3 cache then loads the appropriate data into the L3 cache and mayreturn a response indicating the load was successful, and this responsemay also include the data pulled into the L3 cache. This return messagemay, in certain cases, be discarded.

FIG. 4 is a block diagram of a MSMC bridge 400, in accordance withaspects of the present disclosure. The MSMC bridge 400 includes acluster slave interface 402, which may be coupled to a master peripheralto provide translations services. The cluster slave interface 402communicates with the master peripheral though a set of channels404A-404H. In certain cases, these channels include an ACP channel 404A,read address channel 404B, write address channel 404C, read data channel404D, write data channel 404E, snoop response channel 404F, snoop datachannel 404G, and snoop address channel 404H. The cluster slaveinterface 402 responds to the master peripheral as a slave and providesthe handshake and signal information for communication with the masterperipheral as a slave device. An address converter 406 helps convertread addresses and write addresses as between address formats (e.g.,formats utilizing different numbers of bits) used by the masterperipheral and the MSMC. The ACP, read and write addresses as well asthe read data, write data, snoop response, snoop data and snoop addresspass between a cluster clock domain 408 and a MSMC clock domain 410 viacrossing 412 and on to the MSMC via a MSMC master interface 414. Thecluster clock domain 408 and the MSMC clock domain 410 may operate atdifferent clock frequencies and with different power requirements.

The crossing 412 may use a level detection scheme to asynchronouslytransfer data between domains. In certain cases, transitioning dataacross multiple clock and power domains incur an amount of crossingexpense in terms of a number of clock cycles, in both domains, for thedata to be transferred over. Buffers may be used to store the data asthey are transferred. Data being transferred are stored in asynchronousFIFO buffers 422A-422H, which include logic straddling both the clusterclock domain 408 and the MSMC clock domain 410. Each FIFO buffer422A-422H include multiple data slots and a single valid bit line perdata slot. Data being transferred between may be placed in the dataslots and processed in a FIFO manner to transfer the data as between thedomains. The data may be translated, for example, between the MSMC busprotocol to a protocol in use by the master peripheral while the data isbeing transferred over. This overlap of the protocol conversion with thedomain crossing expense helps limit overall latency for domain crossing.

In certain cases, the ACP channel 404A may be used to help perform cacheprewarming. The ACP channel help allow access to cache of a masterperipheral. When a prefetch message is received, for example from theMRU, the prewarm message may be translated into a format appropriate forthe master peripheral by a message converter 418 and sent, via the ACPchannel 404A to the master peripheral. The master peripheral may thenrequest the memory addresses identified in the prewarm message and loaddata from the memory addresses into the cache of the master peripheral.

In certain cases, the MSMC bridge may be configured to perform errordetection and error code generation to help protect data integrity. Inthis example, error detection may be performed on data returned from aread request from the MSMC master interface 414 by an error detectionunit 426A. Additionally, error detection and error code generation maybe provided by error detection units 426B and 426C for write data andsnoop data, respectively. Error detection and error code generation maybe provided by any known ECC scheme.

In certain cases, the MSMC bridge 400 includes a prefetch controller416. The prefetch controller attempts to predict, based on memoryaddresses being accessed, whether and which additional memory addressesmay be accessed in the future. The prediction may be based on one ormore heuristics, which detects and identifies patterns in memoryaccesses. Based on these identified patterns, the prefetch controller416 may issue additional memory requests. For example, the prefetchcontroller 416 may detect a series of memory requests for set of memoryblocks and identify that these requests appear to be for sequentialmemory blocks. The prefetch controller 416 may then issue additionalmemory requests for the next N set of sequential memory blocks. Theseadditional memory requests may cause, for example, the requested data tobe cached in a memory cache, such as a L2 cache, of the masterperipheral or in a cache memory of the MSMC, such as the RAM banks 218of FIG. 2.

As prefetching may introduce coherency issues where a prefetched memoryblock may be in use by another process, the prefetch controller 416 maydetect how the requested memory addresses are being accessed, forexample, whether the requested memory addresses are shared or owned andadjust how prefetching is performed accordingly. In shared memoryaccess, multiple processes may be able to access a memory address andthe data at the memory address may be changed by any process. For ownedmemory access, a single process exclusively has access to the memoryaddress and only that process may change the data at the memory address.In certain cases, if the memory accesses are shared memory reads, thenthe prefetch controller 416 may prefetch additional memory blocks usingshared memory accesses. The MSMC bridge 400 may also include an addresshazarding unit 424 which tracks each outstanding read and writetransaction, as well as snoop transactions sent to the masterperipheral. For example, when a read request is received from the masterperipheral, the address hazarding unit 424 may create a scoreboard entryto track the read request indicating that the read request is in flight.When a response to the read request is received, the scoreboard entrymay be updated to indicate that the response has been received, and whenthe response is forwarded to the master peripheral, the scoreboard entrymay be cleared. If the prefetch controller 416 detects that the memoryaccess includes owned read or write accesses, the prefetch controller416 may perform snooping, for example by checking with the prefetchcontroller 416 or the snoop filter banks 212 of FIG. 2, to determine ifthe memory blocks to be prefetched are otherwise in use or overlap withaddresses used by other processes. In cases where a prefetched memoryblock is accessed by another process, for example if there areoverlapping snoop requests or a snoop request for an address that isbeing prefetched, then the prefetch controller 416 may not issue theprefetching commands or invalidate prefetched memory blocks.

In certain cases, snoop requests may arrive from the MSMC to the MSMCbridge 400. Where a snoop request from the MSMC for a memory addressoverlaps with an outstanding read or write to the memory address from amaster peripheral, the address hazarding unit 424 may detect the overlapand stall the snoop request until the outstanding read or write iscomplete. In certain cases, read or write requests may be received bythe MSMC bridge for a memory address which overlaps with a snoop requestthat has been sent to the master peripheral. In such cases, the addresshazarding unit 424 may detect such overlaps and stall the read or writerequests until a response to the snoop request has been received fromthe master peripheral.

The address hazarding unit 424 may also help provide memory barriersupport. A memory barrier instruction may be used to indicate that a setof memory operations must be completed before further operations areperformed. As discussed above, the address hazarding unit 424 tracks inflight memory requests to or from a master peripheral. When a memorybarrier instruction is received, the address hazarding unit may check tosee whether the memory operations indicated by the memory barrierinstruction have completed. Other requests may be stalled until thememory operations are completed. For example, a barrier instruction maybe received after a first memory request and before a second memoryrequest. The address hazarding unit 424 may detect the barrierinstruction and stall execution of the second memory request until aftera response to the first memory request is received.

The MSMC bridge 400 may also include a merge controller 420. In certaincases, the master peripheral may issue multiple write requests formultiple, sequential memory addresses. As each separate write requesthas a certain amount of overhead, it may be more efficient to merger anumber of these sequential write requests into a single write request.The merge controller 420 is configured to detect multiple sequentialwrite requests as they are queued into the FIFO buffers and merge two ormore of the write requests into a single write request. In certaincases, responses to the multiple write requests may be returned to themaster peripheral as the multiple write requests are merged and prior tosending the merged write request to the MSMC. While described in thecontext of a write instruction, the merge controller 420 may also beconfigured to merge other memory requests, such as memory read requests.

FIG. 5 is a flow diagram illustrating a technique 500 for accessingmemory by a memory controller, in accordance with aspects of the presentdisclosure. At block 502, a trigger control channel receivesconfiguration information, the configuration information defining afirst one or more triggering events. As an example, the memorycontroller may receive, from an entity, including a peripheral that isoutside of the processing system such as a chip separate from an SoC,configuration information. The configuration information may be receivedvia a privileged process and the configuration information may includeinformation defining trigger events for the channel, along with anindication of an interface that may be used to obtain a memorymanagement command.

At block 504, the trigger control channel receives a first memorymanagement command. For example, the trigger control channel may obtainthe memory management command via the indicated interface from theconfiguration information. At block 506, the first memory managementcommand is stored. At block 508, the trigger control channel detects afirst one or more triggering events. For example, the trigger controlchannel may, based on the configuration information, monitor global andlocal events to detect one or more particular events. When the one ormore particular events are detected, the trigger control channel istriggered.

At block 510 the trigger control channel triggers the stored firstmemory management command based on the detected first one or moretriggering events. For example, the trigger control channel transmitsthe first memory management command to one or more queues forarbitration against other memory management commands. After winning inarbitration, the first memory management command may then be outputtedfor transmission to the appropriate memory location.

Referring back to FIG. 2, the MSMC 200 is configured to provide coherentaccess to the RAM banks 218 and to memory connected to the externalmemory master interfaces for master peripherals connected to the to thecoherent slave interfaces 206 using the hardware snoop filter banks 212.FIG. 6 illustrates an example table 600 of data stored by the snoopfilter banks 212, the cache tag banks 216 and the RAM banks 218. Inparticular, the table 600 includes tag data 602 stored by the cache tagbanks 216, snoop filter data 604 stored by the snoop filter banks 212,and RAM data 606 stored by the RAM banks 218. Each entry in the tag data602 is associated with a corresponding entry in the snoop filter data604 and a corresponding entry in the RAM data 606. Together, the data inthe table 600 comprises a coherent cache in which the tag data 602indicates memory addresses of memory devices connected to the externalmemory master interfaces 222, the snoop filter data 604 indicates snoopstates of memory stored at the corresponding memory addresses, and theRAM data 606 stores cached values associated with the memory addressesor stores “scratch” data. A snoop state indicates whether any cache(e.g., of the master peripherals) stores data associated with acorresponding tag address and what a state of the data in that cache is.For example, the state of the data may be INVALID, CLEAN, or DIRTY.CLEAN indicates that data in the cache matches data in memory. DIRTYindicates that data in the cache has been modified and no longer matchesdata in memory. INVALID indicates that a value stored in the cache isnot valid.

The snoop state may further identify a cache that “owns” the tag address(e.g., has permission to edit data stored in the tag address). The MSMC200 allocates the RAM data 606 between use as cache data and scratchdata based on data stored in the MSMC configuration module 214. RAM datathat is allocated as scratch data is directly accessible to the masterperipherals connected to the coherent slave interfaces 206 while RAMdata that is allocated as cache data corresponds to a cache of datastored in memory devices connected to the external memory masterinterfaces 222. Accordingly, the RAM banks 218 may provide a data cache(e.g., a level 2 or level 3 data cache) between the master peripheralsand the memory devices connected to the external memory masterinterfaces 222, scratch data storage accessible to the masterperipherals, or a combination thereof.

The table 600 illustrates data stored in one of the cache tag banks 216(e.g., the first cache tag bank 216A), one of the RAM banks 218 (e.g.,the first RAM bank 218A), and the snoop filter banks 212 (e.g., thefirst snoop filter bank 212A). Each row of the table corresponds to acache way line that includes elements of the snoop filter banks 212, oneof the cache tag banks 216, and one of the RAM banks 218. These waylines are divided into groups. In the illustrated example, the table 600depicts two groups of four way lines however, in some implementations,each cache tag bank/RAM bank pair includes a different number of waysper group and/or a different number of groups. Similar tables may beformed based on data stored in ways of the other RAM banks 218 and cachetag banks 216. Because each tag entry in the tag data 602 corresponds toboth an entry in the snoop filter data 604 and an entry in the RAM data606, the MSMC 200 may avoid storing separate tag data structures for thesnoop filter data 604 and the RAM data 606. Accordingly, the MSMC 200may require fewer cache tag databanks as compared to implementations inwhich the snoop filter data 604 and the RAM data 606 are independentlymapped to tag data.

The coherency controller 224 is configured to ensure that the masterperipherals have a coherent view of data stored in memory devicesconnected to the external memory master interfaces 222 even inimplementations in which the master peripherals maintain their owncaches. The coherency controller 224 supports various states for datastored in the caches. These states include “modified,” “owned,”“exclusive,” “shared,” and “invalid.” “Modified” indicates that only onecache of a master peripheral has data corresponding to a tag address andthat data associated with the tag address is “dirty.” Dirty means that acached value of data may be different from a value of the data stored inmemory. “Owned” indicates that multiple caches have data correspondingto a tag address and that the data is dirty (e.g., one of the caches maystore a modified version of the data). “Exclusive” indicates that onlyone cache of a master peripheral has data corresponding to a tag addressand that the data is “clean.” Clean means that the data stored in thecache matches data stored in memory. “Shared” indicates that the data islocated in multiple caches and is clean. “Invalid” indicates that nocache stores data associated with a tag address. The snoop filter data604 includes snoop state data that the coherency controller 224 uses tosupport the data states described above.

Examples of snoop filter states that may be indicated by the snoopfilter data 604 include “INVALID,” “CPU*_SHARED,” “CPU*_UNIQUE,”“BROADCAST_SHARED,” and “BROADCAST_UNIQUE.” The “INVALID” stateindicates that a memory block is in an invalid state (or absent) fromall caches of the master peripheral devices. The CPU*_SHARED stateincludes an identifier of a master peripheral and indicates that dataassociated with the state is stored in a cache of that master peripheralin the shared state or the owned state. The CPU*_Unique state includesan identifier of a master peripheral and indicates that data associatedwith the state is stored in a cache of that master peripheral in theshared state, the owned state, the exclusive state, or the modifiedstate. The BROADCAST_SHARED state indicates that data associated withthe state is stored in caches of more than one master peripheral in theshared state or the owned state. The BROADCAST_UNIQUE state indicatesthat data associated with the state is stored in caches of more than onemaster peripheral in the owned state, the exclusive state, or themodified state. The CPU*_SHARED and CPU*_UNIQUE states may include theidentifier of the master peripheral encoded as a saturating vector. Forexample, these states may be indicated by a sequence of bits in which aportion of the bits corresponds to a saturating vector identifying amaster peripheral and a second portion indicates whether the state isSHARED or UNIQUE. The saturating vector indicates an identifier, CPU*,of one master peripheral that caches a data value rather thanidentifying each master peripheral that caches the data value.Accordingly, a number of bit lines used for the snoop filter banks 212scales linearly with a number of master peripherals (or masterperipherals that include a cache).

In the illustrated example, a first entry 602A of the tag data 602 shownin FIG. 6 corresponds to a first entry 604A of the snoop filter data 604and to a first entry 606A of the RAM data 606. The first entry 602A ofthe tag data 602, the first entry 604A of the snoop filter data 604, andthe first entry 606A of the RAM data 606 are stored on a first way of afirst group of ways. This first way corresponds to a cache line that isincluded across the snoop filter banks 212, one of the cache tag banks216, and one of the RAM banks 218. In the illustrated example, the firstentry 602A of the tag data 602 identifies a memory address0x23AEF5939DEA, the first entry 604A of the snoop filter data stores astate of 011_SHARED, and the first entry 606A of the RAM data 606 storesa value of ABCD. Accordingly, FIG. 6 indicates that a cache of a masterperipheral 011 stores a value associated with memory address0x23AEF5939DEA in the shared state or the owned state and that the RAMbanks 218 store a value ABCD associated with the memory address0x23AEF5939DEA.

Further, an eighth entry 602H of the tag data 602 shown in FIG. 6corresponds to an eighth entry 604H of the snoop filter data 604 and toan eighth entry 606H of the RAM data 606 shown in FIG. 6. The eighthentry 602H of the tag data 602, the eighth entry 604H of the snoopfilter data 604, and the eighth entry 606H of the RAM data 606 arestored on a fourth way of a second group of ways. In the illustratedexample, the eighth entry 602H of the tag data 602 identifies a memoryaddress 0x8E3256088321, the eighth entry 604H of the snoop filter datastores a state of 001_SHARED, and the eighth entry 606H of the RAM data606 indicates that the RAM banks 218 do not store a value for the memoryaddress 0x8E3256088321. Accordingly, FIG. 6 indicates that a cache of amaster peripheral 001 stores a value associated with memory address0x8E3256088321 in the shared state or the owned state and that the RAMbanks 218 do not store a value for the memory address 0x8E3256088321. Itshould be noted that while the table 600 illustrates the eighth entry606H of the RAM data 606 as blank, a cache line in the RAM banks 218corresponding to the fourth way of the second group may include data.However, a flag (or other indicator) in the RAM banks 218 may indicatethat the data stored in the fourth way of the second group is invalid orthe fourth way of the RAM bank may be allocated to scratch pad memoryrather than to cache space.

FIG. 7 is a table 700 illustrating under what conditions the coherencycontroller 224 issues snoop requests to the master peripherals and underwhat conditions the coherency controller 224 uses cached data to respondto a memory access request (e.g., a read or write) from the masterperipherals for the INVALID state, the CPU*_SHARED state, and theCPU*_UNIQUE state.

A first row 702 of the table 700 illustrates that, in response toreceiving a read request for a memory address corresponding to a tagthat is cached in the RAM banks 218 (e.g., L3 cache data hit) and forwhich the snoop filter data 604 indicates the snoop state is INVALID,the coherency controller 224 is configured to return a value of the tagfrom the RAM banks 218 without performing a snoop of the masterperipherals. A memory address corresponds to a tag “corresponds” to atag if the memory address is within a range [tag, tag+maximum offset].The maximum offset may be positive or negative and may be based on asize (number of bits) included in each entry of the RAM data 606. Forexample, if the ways of the MSMC 200 support 16 bit entries in the RAMdata 606, a memory address may correspond to a tag if the memory addressfalls within [tag, tag+F].

In an illustrative example of the coherency controller 224 operatingaccording to the first row 702 using the table 600, in response toreceiving a read request from a master peripheral connected to the firstcoherent slave interface 206A for a memory address corresponding to thetag 0x62349FA3CA35, the coherency controller 224 applies the tag to thecache tag banks 216 and determines that there is a hit in the RAM banks218 for this address. Further, the coherency controller 224 determinesthat the snoop state associated with this address is INVALID.Accordingly, the coherency controller 224 retrieves the value cached inthe RAM banks 218 (e.g., 5321) and returns this value to the masterperipheral connected to the first coherent slave interface 206A. Thecoherency controller 224 does not issue a snoop request to the masterperipherals because the snoop filter data 604 indicates that the cachesof the master peripherals do not store a valid value for the address0x62349FA3CA35.

A second row 704 of the table 700 illustrates that, in response toreceiving a read request for a memory address corresponding to a tagthat is cached in the RAM banks 218 (e.g., L3 cache data hit) and forwhich the snoop filter data 604 indicates the snoop state isCPU*_SHARED, the coherency controller 224 is configured to return avalue of the tag from the RAM banks 218 without performing a snoop ofthe master peripherals.

In an illustrative example of the coherency controller 224 operatingaccording to the second row 704 using the table 600, in response toreceiving a read request from a master peripheral connected to the firstcoherent slave interface 206A for a memory address corresponding to thetag 0x23AEF5939DEA, the coherency controller 224 applies the tag to thecache tag banks 216 and determines that there is a hit in the RAM banks218 for this address. Further, the coherency controller 224 determinesthat the snoop state associated with this address is 011_SHARED (e.g.,that a master peripheral with identifier 011 caches a value of0x23AEF5939DEA in a shared state). Accordingly, the coherency controller224 retrieves the value cached in the RAM banks 218 (e.g., ABCD) andreturns this value to the master peripheral connected to the firstcoherent slave interface 206A. The coherency controller 224 does notissue a snoop request to the master peripheral 011 because the snoopfilter data 604 indicates that the master peripheral 011 stores a valueof the address 0x62349FA3CA35 in a shared state and should provideupdates to the coherency controller 224 in response to changing thevalue of the address 0x62349FA3CA35.

A third row 706 and a fourth row 708 indicate that, in response toreceiving a read request for a memory address corresponding to a tagthat is cached in the RAM banks 218 and for which the snoop filter data604 indicates the snoop state is CPU*_UNIQUE, the coherency controller224 is configured to issue a snoop request to CPU*(the master peripheralthat owns the tag). The third row 706 indicates that the coherencycontroller 224 is configured to, in response to receiving a value of thetag from the CPU*, the coherency controller 224 is configured to returnthe value received from the CPU* instead of the value stored in the RAMbanks 218. The fourth row 708 indicates that the coherency controller224 is configured to, in response to receiving not receiving a value(e.g., receiving an indication that the CPU* generated a cache miss inresponse to the tag, receiving an indication that the cache of the CPU*stores an invalid value for the tag, determining that a timeout periodhas elapsed, etc.), the coherency controller 224 is configured to returnthe value store din the RAM banks 218.

In an illustrative example of the coherency controller 224 operatingaccording to the third row 706 and the fourth row 708 using the table600, in response to receiving a read request from a master peripheralconnected to the first coherent slave interface 206A for a memoryaddress corresponding to the tag 0x23AEF5939DEB, the coherencycontroller 224 applies the tag to the cache tag banks 216 and determinesthat there is a hit in the RAM banks 218 for this address. Further, thecoherency controller 224 determines that the snoop state associated withthis address is 001_UNIQUE (e.g., that a master peripheral withidentifier 001 caches a value of 0x23AEF5939DEB in a unique state).Accordingly, the coherency controller 224 issues a snoop request to themaster peripheral 001 to attempt to retrieve a value of the value of thetag 0x23AEF5939DEB stored by the master peripheral 001. If the coherencycontroller 224 receives a value for the tag 0x23AEF5939DEB from themaster peripheral 001 in response to the snoop request, the masterperipheral 001 returns that value to the master peripheral connected tothe first coherent slave interface 206A without accessing the RAM banks218, but if no value for the tag 0x23AEF5939DEB is received from themaster peripheral 001, the coherency controller 224 returns the valuefor the tag 0x23AEF5939DEB stored in the RAM banks 218 (e.g., 3210 inFIG. 6).

A fifth row 710 of the table 700 illustrates that, in response toreceiving a write request for a memory address that is cached in the RAMbanks 218 (e.g., L3 cache data hit) and for which the snoop filter data604 indicates the snoop state is INVALID, the coherency controller 224is configured to write a value of the memory address from the RAM banks218 without performing a snoop of the master peripherals. The coherencycontroller 224 may write a new value to the RAM banks 218 based on thewrite request. It should be noted that the write request may specify adata value that uses fewer bits than the value stored for the memoryaddress by the RAM banks 218. Accordingly, the coherency controller 224may utilize a mask to update a portion of the value stored in the RAMbanks 218 based on the data value specified in the write request (e.g.,using an address offset from the tag to the memory address indicated inthe write request).

In an illustrative example of the coherency controller 224 operatingaccording to the fifth row 710 using the table 600, in response toreceiving a write request from a master peripheral connected to thefirst coherent slave interface 206A to write a value “1” to a memoryaddress corresponding to the tag 0x62349FA3CA35, the coherencycontroller 224 applies the tag to the cache tag banks 216 and determinesthat there is a hit in the RAM banks 218 for this address. Further, thecoherency controller 224 determines that the snoop state associated withthis address is INVALID. Accordingly, the coherency controller 224writes the value “1” to the third way of the RAM banks 218. Thecoherency controller 224 may write the value “1” apply a mask tooverwrite a portion of value 5321 stored in the third way of the firstgroup. For example, if the memory address identified by the writerequest is equal to the tag stored in the tag data 602, an offsetidentified for the write request is “0”, accordingly, the coherencycontroller 224 may overwrite the “5” in the 0th position of “5321” witha “1” and store “1321” in the RAM banks 218. The coherency controller224 may further return an indication of a successful write to the masterperipheral connected to the first coherent slave interface 206A.Additionally, the coherency controller 224 may issue a write request tothe external memory interleave 220 to write “1321” to memory address0x62349FA3CA35 through the external memory master interfaces 222.

A sixth row 712 of the table 700 illustrates that, in response toreceiving a write request for a memory address corresponding to a tagthat is cached in the RAM banks 218 (e.g., L3 cache data hit) and forwhich the snoop filter data 604 indicates the snoop state isCPU*_SHARED, the coherency controller 224 is configured to issue a snooprequest to the master peripheral identified by CPU* and to access theRAM banks 218. The snoop request to the master peripheral CPU* mayrequest that the master peripheral identified by CPU* writeback andinvalidate the value cached by the master peripheral for the tag. Thecoherency controller 224 may further be configured to issue snooprequests to all master peripherals indicating that values for the tagare to be set to the invalid state. The coherency controller 224 mayupdate the RAM banks 218 based a value included in the write request andbased on a value returned by the master peripheral CPU*. The coherencycontroller 224 may further issue a write request to output the updatedvalue to the external memory interleave 220 for output to the externalmemory master interfaces 222. It should be noted that the coherencycontroller 224 may not issue a snoop request to the master peripheralCPU* in examples in which the master peripheral CPU* is the masterperipheral that issued the write request. The coherency controller 224is further configured to return a write status indicator to the masterperipheral that originated the write request.

In an illustrative example of the coherency controller 224 operatingaccording to the sixth row 712 using the table 600, in response toreceiving a write request from a master peripheral connected to thefirst coherent slave interface 206A to write a value of “3” to a memoryaddress corresponding to the tag 0x23AEF5939DEA, the coherencycontroller 224 applies the tag to the cache tag banks 216 and determinesthat there is a hit in the RAM banks 218 for this address. Further, thecoherency controller 224 determines that the snoop state associated withthis address is 011_SHARED (e.g., that a master peripheral withidentifier 011 caches a value of 0x23AEF5939DEA in a shared state).Accordingly, the coherency controller 224 issues a snoop request to the011 master peripheral to cause the 011 master peripheral to writeback(to the MSMC 200) and invalidate the 011 master peripheral's cachedvalue for 0x23AEF5939DEA. The coherency controller 224 further issuessnoop requests to the other master peripherals instructing the othermaster peripherals to invalidate entries for the tag 0x23AEF5939DEA. Thecoherency controller 224 overwrites a value returned by the masterperipheral 011 responsive to the writeback request with the value “3”and stores the new value in the RAM banks 218 in place of “ABCD.” Insome implementations, the coherency controller further issues a writerequest to the external memory interleave 220 to write the new value tomemory connected to the external memory master interfaces 222. Inaddition, the coherency controller 224 sends a notification to themaster peripheral connected to the first coherent slave interface 206Aindicating a successful write.

A seventh row 714 of the table 700 illustrates that, in response toreceiving a write request for a memory address corresponding to a tagthat is cached in the RAM banks 218 (e.g., L3 cache data hit) and forwhich the snoop filter data 604 indicates the snoop state isCPU*_UNIQUE, the coherency controller 224 is configured to issue a snooprequest to the master peripheral identified by CPU* and to access theRAM banks 218. The snoop request to the master peripheral CPU* mayrequest that the master peripheral identified by CPU* writeback (to theMSMC 200) invalidate the value cached by the master peripheral for thetag. The coherency controller 224 may then update the RAM banks 218based a value included in the write request. The coherency controller224 may further issue a write request to the external memory interleave220 for output to the external memory master interfaces 222. It shouldbe noted that the coherency controller 224 may not issue a snoop requestto the master peripheral CPU* in examples in which the master peripheralCPU* is the master peripheral that issued the write request.

In an illustrative example of the coherency controller 224 operatingaccording to the seventh row 714 using the table 600, in response toreceiving a write request from a master peripheral connected to thefirst coherent slave interface 206A to write a value of “3” to a memoryaddress corresponding to the tag 0x23AEF5939DEB, the coherencycontroller 224 applies the tag to the cache tag banks 216 and determinesthat there is a hit in the RAM banks 218 for this address. Further, thecoherency controller 224 determines that the snoop state associated withthis address is 001_UNIQUE (e.g., that a master peripheral withidentifier 001 caches a value of 0x23AEF5939DEB in a unique state).Accordingly, the coherency controller 224 issues a snoop request to the001 master peripheral to cause the 001 master peripheral to writebackand invalidate the 001 master peripheral's cached value for0x23AEF5939DEB. As an example, the master peripheral may return “0000”as the cached value for 0x23AEF5939DEB. Accordingly, the coherencycontroller 224 overwrites “0000” or a portion thereof with “3” resultingin “3000,” for example, and stores “3000” in the RAM banks 218 on theway associated with the address 0x23AEF5939DEB. Further, the coherencycontroller 224 may issue a request to write “3000” to the address0x23AEF5939DEB to the external memory interleave 220 for output to theexternal memory master interfaces 222. In addition, the coherencycontroller 224 returns an indication of a successful write to the masterperipheral connected to the first coherent slave interface 206A.

An eighth row 716 of the table 700 illustrates that, in response toreceiving a read request for a memory address corresponding to a tagthat is not cached in the RAM banks 218 (e.g., L3 cache data miss) andfor which the snoop filter data 604 indicates the snoop state isINVALID, the coherency controller 224 is configured to issue a readrequest to the external memory interleave 220 to be forwarded to one ofthe external memory master interfaces 222. The coherency controller 224receives a response to the read request sent to the external memoryinterleave 220 and returns a result to the master peripheralaccordingly. Further, the coherency controller 224 may update the snoopfilter banks 212A, cache tag banks 216, and RAM banks 218 based on aresult.

In an illustrative example of the coherency controller 224 operatingaccording to the eighth row 716 using the table 600, in response toreceiving a read request from a master peripheral connected to the firstcoherent slave interface 206A for a memory address corresponding to thetag 0x52955AC3F329, the coherency controller 224 applies the tag to thecache tag banks 216 and determines that there is a miss in the RAM banks218 for this address. Further, the coherency controller 224 determinesthat the snoop state associated with this address is INVALID.Accordingly, the coherency controller 224 issues a request to theexternal memory interleave 220 to retrieve data for the tag0x52955AC3F329 from the external memory master interfaces 222. Once thecoherency controller 224 receives data for the tag 0x52955AC3F329, thecoherency controller 224 may update the RAM bank 218 to store the datafor the tag 0x52955AC3F329 and send the data for the tag 0x52955AC3F329to the master peripheral connected to the first coherent slave interface206A. In addition, the coherency controller 224 may set a snoop statefor the tag 0x52955AC3F329 in the snoop filter banks 212 to indicatethat the master peripheral connected to the first coherent slaveinterface 206A has data for the tag 0x52955AC3F329. The state may be oneof CPU*_SHARED and CPU*_UNIQUE and may be selected based on the readrequest received from the master peripheral connected to the firstcoherent slave interface 206A. For example, a read request from themaster peripheral may indicate that the master peripheral will cache areceived value in the shared state or that the master peripheral willcache the received value in the unique state. In some implementations,the coherency controller 224 is configured to “promote” an initialrequest for data (e.g., a request that for data for which no snoopfilter state exists or for which a snoop filter state is INVALID) from arequest for shared access to request for unique access.

A ninth row 718 and a tenth row 720 of the table 700 illustrate that, inresponse to receiving a read request for a memory address correspondingto a tag that is not cached in the RAM banks 218 (e.g., L3 cache datamiss) and for which the snoop filter data 604 indicates the snoop stateis CPU*_SHARED, the coherency controller 224 is configured to issue asnoop request (e.g., a snoop read) to the master peripheral identifiedby CPU*. In response to receiving data for the tag in response to thesnoop request, the coherency controller 224 is configured to output thedata to the requesting master peripheral without accessing the externalmaster memory interfaces 222. Further, the coherency controller 224 mayupdate the RAM banks 218 to store the data. In response to receiving nodata for the tag in response to the snoop request (e.g., a timeout, aninvalid indication, a cache miss indication, etc.) the coherencycontroller 224 is configured to issue a request to the external memoryinterleave 220. In response to receiving data from the external memoryinterleave 220, the coherency controller 224 is configured to return thedata to the requesting master peripheral. In addition, the coherencycontroller 224 may update the RAM banks 218 to store the data and updatethe snoop filter banks 212 to indicate that the data associated with thetag is invalid for CPU*.

In an illustrative example of the coherency controller 224 operatingaccording to the ninth row 718 and the tenth row 720 using the table600, in response to receiving a read request from a master peripheralconnected to the first coherent slave interface 206A for a memoryaddress corresponding to the tag 0x8E3256088321, the coherencycontroller 224 applies the tag to the cache tag banks 216 and determinesthat there is a miss in the RAM banks 218 for this tag. Further, thecoherency controller 224 determines that the snoop state associated withthis address is 001_SHARED (e.g., that a master peripheral withidentifier 001 caches a value of 0x8E3256088321 in a shared state).Accordingly, the coherency controller 224 issues a snoop request to the001 master peripheral in an attempt to retrieve its cached value for0x8E3256088321. If the 001 master peripheral returns a value for0x8E3256088321, the coherency controller 224 is configured to return thevalue to the master peripheral connected to the first coherent slaveinterface 206A without accessing the external memory master interfaces222. Further, the coherency controller 224 may update the RAM banks 218so that the RAM data 606 includes the value of tag 0x8E3256088321. Ifthe 001 master peripheral does not return a value for 0x8E3256088321,the coherency controller 224 is configured to send a read request forthe tag 0x8E3256088321 to the external memory interleave 220. Theexternal memory interleave 220 is configured to pass the request to oneof the external memory master interfaces 222 and return a receivedresult to the coherency controller 224. The coherency controller 224 isconfigured to return the result to the master peripheral connected tothe first coherent slave interface 206A and may update the RAM banks 218so that the RAM data 606 includes the value of tag 0x8E3256088321.Further, the coherency controller 224 may update the snoop filter bank212 to indicate that data for the 0x8E3256088321 tag is INVALID (ornon-existent) at the 001 master peripheral.

An eleventh row 722 and a twelfth row 724 of the table 700 illustratethat, in response to receiving a read request for a memory addresscorresponding to a tag that is not cached in the RAM banks 218 (e.g., L3cache data miss) and for which the snoop filter data 604 indicates thesnoop state is CPU*_UNIQUE, the coherency controller 224 is configuredto perform the same basic actions as if the snoop state wereCPU*_SHARED. However, in addition, the coherency controller 224 may beconfigured to update the snoop filter banks 212 to indicate that thesnoop filter state for the tag is CPU*_SHARED and to send a snooprequest instructing the CPU* to change its cache state to shared for thetag.

A thirteenth row 726, a fourteenth row 728, and a fifteenth row 730illustrate that the coherency controller 224 is configured to respond towrite requests for addresses corresponding to tags not cached in the RAMbanks 218 as shown in rows 610-614 except utilizing the external memoryinterleave 220 to access the external memory master interfaces 222rather than utilizing the RAM banks 218.

As illustrated in the table 700, the coherency controller 224 need notissue snoop requests to the master peripherals in response to everyrequest because the snoop filter includes state information.Accordingly, the MSMC 200 may snoop the master peripherals lessfrequently as compared to coherency systems that do not maintain snoopfilter data. Further, as shown in FIG. 2, because the snoop filter banks212 are connected to the same cache tag banks 216 as the RAM banks 218,the hardware snoop filter may be implemented using fewer components ascompared to implementations that include separate cache tag banks forsnoop filter banks and RAM banks. Further, the coherency controller 224is configured to access each snoop filter bank-cache tag bank-RAM bankgrouping in parallel.

While not illustrated in FIG. 7, the coherency controller 224 may beconfigured to issue no snoop requests for a tag in response todetermining that corresponding snoop filter state is BROADCAST_SHAREDand that data for the tag is cached in the RAM banks 218. Alternatively,the coherency controller 224 may be configured to broadcast snooprequests to all master peripherals in response to determining that thesnoop filter state is BROADCAST_UNIQUE or in response to determiningthat the snoop filter state is BROADCAST_SHARED but no data for the tagis cached in the RAM banks 218.

Referring to FIG. 8, a flowchart illustrating a method 800 of processingmemory access requests is shown. The method 800 may be performed by amulti-core shared memory controller, such as the MSMC 200 of FIG. 2. Themethod 800 includes receiving, at a MSMC, a request from a peripheraldevice connected to the MSMC to access a memory address, the requestcorresponding to a read request or to a write request. For example, theMSMC 200 may receive a read request or a write request from a masterperipheral connected to one of the coherent slave interfaces 206 (e.g.,one of the processor packages 104 or another master peripheral).

The method 800 further includes applying, at the MSMC, a tag associatedwith the memory address to a cache tag bank of the MSMC to identify asnoop filter state of the tag stored in a snoop filter bank connected tothe cache tag bank and a cache hit status of the tag in a memory bankconnected to the cache tag bank, at 804. For example, the coherencycontroller 224 may determine a tag associated with the addressidentified by the read or write request (e.g., by masking out a numberof least significant bits of the address). The coherency controller 224may further apply the tag to the cache tag banks 216 to determine asnoop filter state for the tag stored in the snoop filter banks 212 andto determine a cache hit status of the tag in the RAM banks 218. In someimplementations, the coherency controller 224 selects which snoop filterbank-cache tag bank-RAM bank group to search based on the tag (e.g.,based on one or more most significant bits of the tag). The cache hitstatus indicates whether a value associated with the tag is stored inthe RAM banks 218 (e.g., a cache hit) or not (e.g., a cache miss).

The method 800 further includes determining whether to issue a snooprequest to a device connected to the MSMC based on the snoop filterstate and the cache hit status, at 806. For example, the coherencycontroller 224 may determine whether to issue snoop requests to one ormore master peripherals connected to the coherent slave interfaces 206based on the snoop filter state and the cache hit status as illustratedin FIG. 6 and described in the corresponding description above.Accordingly, the MSMC 200 may provide coherent memory accesses withoutissuing snoop requests in response to every memory access request.

Referring to FIG. 9, a diagram 900 illustrating read-modify-write (RMW)queues that may be included in the MSMC 200 is shown. The diagram 900illustrates that the MSMC 200 may include a RMW queue 902 for each ofthe RAM banks 218. Each RMW queue 902 is configured to receive read andwrite requests from the data path 262 for memory addresses associatedwith the corresponding RAM bank 218. Memory addresses associated with aRAM bank include addressable memory addresses within the RAM bank aswell as memory addresses of an external memory device that are allocatedto ways of the RAM bank. For example, a first RMW queue 902A may receiveread/write request for addressable memory within the first RAM bank 218Aor a read/write request. The RMW queues 902 perform credit basedarbitration (as described further herein) to arbitrate between requestswhile maintaining a sequence of requests to access a particular memoryaddress. For example, the RMW queues 902 may ensure that an order of asequence of requests to access memory address A is maintained when thesequence of requests is output to the RAM banks 218 and/or the externalmemory interleave 220. Further, the RMW queues 902 are configured tosupport writes of data that include fewer bits than a number of bitsstored at a memory address in an addressable memory space (e.g., withinan external memory device or one of the RAM banks 218) or at data cacheentry included in the RAM banks 218. The RMW queues 902 may align thewritten bits (e.g., based on an offset) with the data in memory andwrite over a portion of the data corresponding to the written data whilethe remainder of the data in memory.

The external memory interleave 220 outputs read and write requests tothe external memory master interfaces 222. The external memoryinterleave 220 may perform credit based arbitration to select whichrequest (or requests) to output to the external memory master interfaces222 each clock cycle as described further herein. Further, the externalmemory interleave 220 is configured to interleave accesses to theexternal memory master interfaces 222 (and the external memory devicesconnected to the external memory master interfaces 222) by interleavinga memory space of the external memory devices connected to the externalmemory master interfaces 222. FIG. 10 illustrates a first example inwhich the external memory interleave 220 divides a memory spaceasymmetrically between memory devices. The external memory interleave220 may implement asymmetrical interleaving as shown in FIG. 10 inexamples in which external memory devices connected to the externalmemory master interfaces 222 have different storage capacities. In anasymmetrical interleave scheme, the external memory interleave 220interleaves addresses (or equally sized ranges of addresses) of theexternal memory devices connected to the external memory interface toform an address space until the external memory interleave 220. Further,the external memory interleave 220 adds a separated range of addressesfrom the relatively larger external memory device to the interleavedaddress space to form an external memory address range addressable bydevices connected to the MSMC 200. In the illustrated example, anexternal memory address range supported by the MSMC 200 is generatedfrom a first external memory device “EMIF 0” and a second externalmemory device “EMIF 1”. EMIF 1 has a large capacity than the EMIF 0. Theexternal memory interleave 220 generates the external memory addressrange by interleaving ranges 1010 and 1006 from the EMIF 0 with addressranges 1004 and 1008 from the EMIF 1. A remaining range of addresses1002 from the EMIF 0 is added to the external memory address range.

FIG. 11 illustrates that the external memory interleave 220 mayinterleave or separate memory addresses from symmetrical external memorydevices to form an external memory address range addressable by devicesconnected to the MSMC 200. The In a first example 1100, address rangesfrom two external memory devices are interleaved evenly while, in asecond example 1102, address ranges from two external memory devices areseparated into two distinct ranges within the external memory addressrange. Thus, FIGS. 10-11 illustrate different techniques the externalmemory interleave 220 may use to combine memory address spaces from aplurality of external memory devices into an external memory addressrange addressable by devices connected to the MSMC 200. Because theexternal memory address range addressable by devices connected to theMSMC 200 includes address ranges corresponding to different externalmemory devices, memory access requests (e.g., reads and writes) to theexternal memory address range are routed to different ones of theexternal memory master interfaces 222. Accordingly, accesses to theexternal memory master interfaces 222 are interleaved based on theaddressing scheme applied by the external memory interleave 220.

Referring to FIG. 12, detail of the MSMC configuration module 214 isshown. As illustrated, the MSMC configuration module 214 includes one ormore starvation registers 1202, a cache configuration register 1204, anda configuration arbiter 1206. The MSMC configuration module 214 mayinclude more or fewer components and depicted components may be combinedinto a single component or split into a plurality of components. Theconfiguration arbiter 1206 is configured to perform credit basedarbitration of requests to read from or write to the cache configurationregister 1204 and the starvation registers 1202 received via the commondata path 262. As described further herein, such arbitration may becredit based. The cache configuration register 1204 may correspond tothe MMR 302 of FIG. 3. The starvation registers 1202 are configured tostore starvation bound values associated with the coherent slaveinterfaces 206. As explained herein, the starvation bound valuesindicate a tolerance of requests from a master peripheral to requeststarvation. These starvation bound values may be set based on requestsreceived from the coherent slave interfaces 206 through the data path262. The cache configuration register 1204 stores settings indicatingwhich ways of the MSMC 200 are allocated to cache space and which waysof the MSMC 200 are addressable by the master peripherals for datastorage. Further, the cache configuration register 1204 may store avalue identifying which ways of the MSMC 200 are to be used for“real-time” requests and which ways of the MSMC 200 are to be used for“non-real time” requests. For example, the cache configuration register1204 may store one or more bit masks usable by the coherency controller224 to allocate ways to a “real-time” priority or to a “non-real-timepriority.”

FIG. 13 illustrates a diagram 1300 of ways of the MSMC 200 allocatedbetween a master group #1 and a remainder of master peripherals. Themaster group #1 may correspond to peripherals associated with the“real-time” priority. The cache configuration register 1204 may beconfigured to store an indication (e.g., received from the masterperipheral) of what group each master peripheral belongs to. In responseto receiving a memory access request (e.g., a read or a write) from amaster peripheral for a memory address not included in the cache tagbanks 216, the coherency controller 224 is configured to allocate a wayto a cache tag associated with a memory address indicated by the memoryaccess request. The coherency controller 224 may determine the way basedon the settings stored in the cache configuration register 1204.

FIG. 14 depicts circuitry 1400 that may be included in the coherencycontroller 224 to allocate a way to a cache tag associated with a memoryaddress included in a memory access request. The circuitry 1400 isconfigured to receive a randomly generated allocation pointer 1402, anAND mask 1404 and an OR mask 1406. The AND mask and the OR mask may bestored in the cache configuration register 1204. The coherencycontroller 224 may retrieve the AND mask 1404 and the OR mask 1406 basedon a group membership of the master peripheral associated with thememory access request (e.g., whether the master peripheral is areal-time or non-real-time peripheral). The circuitry 1400 is configuredto perform a first AND operation on a first bit of the randomlygenerated allocation pointer 1402 and a first bit of the AND mask 1404and a second AND operation on a second bit of the randomly generatedallocation pointer 1402 and a second bit of the AND mask 1404. Thecircuitry 1400 is configured to perform a first OR operation on a firstbit of the OR mask 1406 and a result of the first AND operation and toperform a second OR operation on a second bit of the OR mask 1406 and aresult of the second AND operation. A result of the first OR operationcorresponds to a first bit of a way identifier 1410 and a result of thesecond OR operation corresponds to a second bit of the way identifier1410. The circuitry 1400 is configured to output three most significantbits of the randomly generated allocation pointer 1402 as a groupidentifier 1408. The coherency controller 224 is configured to allocatea way identified by the way identifier 1410 in a way group identified bythe way group identifier 1408 to the cache tag associated with thememory address identified by the request that prompted way allocation.The AND mask 1404 and the OR mask 1406 ensure that only ways assigned tothe master peripheral (or master peripheral group) are selected by thecircuitry 1400. Other types of way allocation circuitry may be includedin the coherency controller 224 to allocate ways based on settings inthe cache configuration register 1204.

As described above, the MSMC 200 includes a plurality of ways. A dataportion of each way is included in one of the RAM banks 218, while acache tag data portion of the way is included in corresponding one ofthe cache tag banks 216 and a snoop filter data portion of the way isincluded in a corresponding one of the snoop filter banks 212. The waysare arranged in groups (e.g., of 4). The coherency controller 224 isconfigured to allocate the ways of the MSMC 200 between storage spaceand cache space based on one or more settings included in the cacheconfiguration register 1204. However, rather than assigning an entiregroup to storage or cache, the coherency controller 224 may individuallyallocate data portions of the ways to storage or cache. For example, way2 of each group may be allocated to data (or cache) rather thanallocating entire way groups to data or cache in blocks. Further, thesnoop filter data and cache tag data for ways allocated to addressablestorage may continue to be maintained by the coherency controller 224.Accordingly, the coherency controller 224 may continue to track datacached at the master peripherals even when ways are allocated toaddressable storage.

FIG. 15 illustrates that data portions of ways within the RAM banks 218may be allocated between addressable storage space and cache space basedon one or more settings in the cache configuration register 1204. FIG.16 depicts examples of different allocations way data portions betweencache and addressable memory space. In a first example, 1600 all waydata portions are allocated to cache space. In the first example 1600,each cache tag portion 1606 of each way is configured to store a cachetag and each snoop filter data portion 1608 is configured to store asnoop filter state associated with the cache tag. The snoop filter dataportion 1608 indicates a cache status of the cache tag identified by thecache tag data portion of the way in one or more caches of masterperipherals 1604. The cache tag data portions 1606 correspond to thecache tag banks 216, the snoop filter data portions 1608 correspond tothe snoop filter banks 212, and the data portions 1610 correspond to theRAM banks 218. The master peripherals 1604 may correspond to peripheralsconnected to the coherent slave interfaces 206 (e.g., may correspond tothe processing clusters 102). The first example 1600 further illustratesthat a data portion of each way includes a cached data value associatedwith the cache tag stored in the cache tag portion of the way.

In a second example 1602, way 2 in each group (e.g., set) of ways isallocated to addressable memory. For example, in response a change inthe configuration register 1204 the coherency controller 224 mayallocate way 2 of each group to addressable memory space accessible bythe master peripherals 1604. The coherency controller 224 is configuredto divide the data portion 1610 of ways allocated to addressable datainto a storage portion and into a storage snoop filter portion as shownin the data portion of way 2 1612 of group 1. The storage snoop filterportion stores a snoop filter state indicating a cache status of anaddress of the data portion of the way in the master peripherals 1604.In response a way being allocated to addressable memory space, thecoherency controller 224 is configured to respond to read and writerequests from the master peripherals 1604 to read data from or writedata to a storage portion of the data portion of the way. Further, thecoherency controller 224 is configured to update the storage snoopfilter portion of the data portion of the way based on the memory accessrequests. Accordingly, the coherency controller 224 may track a snoopstate of addressable data stored in the RAM banks 218. FIG. 17illustrates a third example 1700 in which all of the ways are allocatedto addressable storage and none of the ways are allocated to data cache.

In addition, to providing a configurable cache, the MSMC 200 isconfigured to establish virtual channels over the common data path 262between components of the MSMC 200. The arbiter circuit 260 may beconfigured to establish the virtual channels by adding channelidentifiers to requests before submitting the requests to the data path262. Devices connected to the common data path 262 are configured torespond to particular virtual channel identifiers. To illustrate, thearbiter circuit 260 may receive a memory access request (e.g., a read ora write) from one of the coherent slave interfaces 206 and determine(e.g., in conjunction with the coherency controller 224) that the memoryaccess request is to be fulfilled based on a read from the first RAMbank 218A. Accordingly, the arbiter circuit 260 may modify the memoryaccess request (or generate a new request) to include a channelidentifier recognized by the first RMW queue 902A associated with thefirst RAM bank 218A. The first RMW queue 902A may retrieve the memoryaccess request for further processing in response to recognizing thechannel identifier while other components e.g., the second RMW queue902B ignores the memory access request. Because the MSMC 200 utilizes ashared data path rather than unique connections between each component,the MSMC 200 may include less wiring as compared to other devices.

The arbiter circuit 260 is configured to arbitrate access to the commondata path 262 by various components of the MSMC 200 using a multi-layerarbitration technique. The arbiter circuit 260 is configured to trackcredits associated with each resource connected to the common data path.The credits associated with a resource may correspond to available spacein one or more queues of the resource. Each request received by thearbiter circuit 260 has an associated credit cost. For each requestunder consideration by the arbiter circuit 260, the arbiter circuit 260compares a credit cost of the request to a number of available credits.The arbiter circuit 260 is configured to select an arbitration winnerfrom among requests having a credit cost that is less than or equal to anumber of available credits at an associated resource. In response tothere being more than one request having a credit cost less than orequal to an associated number of available credit cost, the arbitercircuit 260 is configured to consider priority, a sharing algorithm, ora combination thereof.

The arbiter circuit 260 may determine priority of a request based asource of the request and a setting in the cache configuration register1204 and/or based on an indicator in the request. In someimplementations, the arbiter circuit 260 is configured to select awinner from a relatively higher priority group (e.g., real timepriority) each time a request from a relatively higher priority group isavailable. In other implementations, the arbiter circuit 260 isconfigured to select from the relatively higher priority group aparticular number of times before selecting from a relatively lowerpriority group.

The arbiter circuit 260 may be configured to promote a request to ahigher priority level in response to the request losing arbitration fora number of clock cycles that satisfies a starvation bound value (e.g.,a starvation threshold) stored in a starvation register 1202. Thestarvation bound value may correspond to a source of the request (e.g.,each of the coherent slave interfaces 206 may have a correspondingstarvation bound value) or a group to which the source of the requestbelongs.

Between requests of the same priority, the arbiter circuit 260 mayemploy a sharing algorithm, such as fair-share or round robin, to selectan arbitration winner. The sharing algorithm may be performed based on asource of the request to prevent a single requestor from dominatingtraffic on the common data path 262.

Once the arbiter circuit 260 selects a request as an arbitration winner,the arbiter circuit 260 is configured to drive the request (e.g.,modified to identify a virtual channel) to the common data path 262 anddecrements a number of available credits associated with a resource thatis a target of the request by a credit cost of the request. The arbitercircuit 260 is configured to increase the number of credits available tothe resource in response to receiving an acknowledgement that therequest has been processed by the resource, based on passing of time, ora combination thereof.

Requests received by the arbiter circuit 260 may have different creditcosts. In some implementations, the arbiter circuit 260 is configured toimplement a credit hiding technique to prevent lower cost requests frommonopolizing the common data path 262. According to the credit hidingtechnique, the arbiter circuit 260 is configured to “hide” creditsassociated with a resource in response to the number of creditsassociated with the resource falling to a lower credit threshold (e.g.,zero credits). While the arbiter circuit 260 hides the creditsassociated with the resource, the arbiter circuit 260 selects norequests targeting the resource as an arbitration winner. The arbitercircuit 260 hides the credits for the resource until the number ofcredits available for the resource reaches an upper credit threshold.The upper credit threshold may be equal to a highest cost of possiblerequests for the resource that the arbiter circuit 260 is configured toreceive. Accordingly, relatively lower credit cost requests for aresource may be prevented from “locking out” relatively higher creditcost requests for the resource once a number of available credits fallsbelow the relatively higher credit cost. It should be noted that thiscredit hiding technique may be implemented by devices other than thearbiter circuit 260. For example, the credit hiding technique describedherein may be implemented by an arbiter circuit (or by a processorexecuting arbitration instructions stored in a memory device) in anycredit based arbitration system.

The arbiter circuit 260 is configured to perform arbitration in twophases in some implementations. In such implementations, the arbitercircuit 260 selects a pre-arbitration winner in a first clock cycle andselects a final arbitration winner in a second subsequent clock cycle.The arbiter circuit 260 may select the pre-arbitration winner in thefirst clock cycle using the multi-layer arbitration process describedabove during the first cycle. In the second clock cycle, the arbitercircuit 260 may compare a priority of the pre-arbitration winner to oneor more priorities of subsequently received requests to determine afinal arbitration winner and drive the final arbitration winner to thedata path 262.

The arbiter circuit 260 may be configured to perform additionalfunctions during the first clock cycle (e.g., during pre-arbitration).For example, during pre-arbitration, the arbiter circuit 260 mayclassify requests as destined for a local resource (e.g., within theMSMC 200) or destined for an external resource (e.g., an external memorydevice connected to the external memory master interfaces 222). Thearbiter circuit 260 may further classify requests as blocking ornon-blocking during pre-arbitration. Requests that may be stalledpending resolution of a snoop request are blocking requests. The arbitercircuit 260 is configured to ensure that blocking requests are grantedaccess to the data path 262 in sequence to maintain coherency of memorymanaged by the MSMC 200. Further, the arbiter circuit 260 may place anon-blocking request on the data path 262 in advance of a previouslyreceived blocking request.

In addition to the arbiter circuit 260, the MSMC 200 includes furtherarbiters. For example, the MSMC configuration module 214 includes theconfiguration arbiter 1206 configured to arbitrate access to thestarvation registers 120 s and the cache configuration register 1204.Further, the MSMC 200 includes the RMW queues 902 configured toarbitrate access to the RAM banks 218 and the external memory interleave220. In addition, the external memory interleave 220 is configured toarbitrate access to the external memory master interfaces 222. The RMWqueues 902, the configuration arbiter 1206, and the external memoryinterleave 220 may implement the same multi-layer hybrid credit basedarbitration technique as the arbiter circuit 260 to arbitrate betweenrequests.

In addition to providing configurable cache and credit basedarbitration, the MSMC 200 is configured to provide various errordetection and correction functionalities. The arbiter circuit 260 isconfigured to generate a Hamming code for all data (e.g., in writerequests) received from the coherent slave interfaces 206. The Hammingcode may include an out of band Hamming code. In contrast to normalHamming codes that intersperse code bits within data bits, the out ofband Hamming code comprises a continuous sequence of code bits placedbefore or after the data bits. Accordingly, the out of band Hamming codemay provide the same level of protection as a normal Hamming code, butthe arbiter circuit 260 (and other components that utilize the out ofband Hamming code) may include relatively simpler comparison logic tocheck the out of band Hamming code because all of the bits of the out ofband Hamming code are arranged together.

The arbiter circuit 260 is configured to transmit the Hamming codethrough the common data path 262 to all recipients of the data. Inaddition, all components of the MSMC 200 that utilize the data areconfigured to calculate a test Hamming code based on the data andcompare the test Hamming code to the Hamming code to determine whetherany bit errors have occurred in the data. In response to detecting noerror, the components are configured to utilize the data as normal. Eachcomponent in the MSMC 200 that utilizes data is configured to, inresponse to detecting a single bit error to correct the bit error in thedata based on a difference between the test Hamming code and the Hammingcode and utilize the corrected data as normal. Each component in theMSMC 200 that utilizes data may be configured to, in response todetecting a multi bit error to return an error code. As used herein, adevice “utilizes” data when the device writes the data to memory oroutputs the data from the MSMC 200. Accordingly, the RMW queues 902utilize data when writing the data to the RAM banks 218 or to theexternal memory interleave 220. Further, the external memory interleave220 utilizes the data when writing the data to external memory. Inaddition, the arbitration and data path manager 204 utilizes data whenoutputting the data to the coherent slave interfaces 206. The Hammingcode may be written to memory (e.g., by the RMW queues 902 or theexternal memory interleave 220) along with the data. Thus, the MSMC 200is configured to protect data upon entry into the MSMC 200 and at everystage of use.

In addition, the MSMC 200 may protect memory addresses identified inmemory access requests as well. For example, the arbiter circuit 260 maybe configured to generate an address Hamming code for an addressidentified in a received memory access request. In cases in which thememory access request is a write request identifying data, the arbitercircuit 260 may transmit the address Hamming code with the dataidentified in the write request and the Hamming code of the data on thecommon data path 262. In cases in which the memory access request is aread request, the arbiter circuit 260 may transmit the address Hammingcode with on the common data path 262.

Each component of the MSMC 200 configured to use the address identifiedin the memory access request is configured to calculate a test addressHamming code based on the address and compare the test address Hammingcode to the address Hamming code. As with the Hamming codes describedfor data, the components of the MSMC 200 may be configured to correctsingle bit errors in the address based on a difference between theaddress Hamming code and the test Hamming code and may be configured togenerate an error message in response to detecting a multi-bit error.

In response to write requests, the external memory interleave 220 andthe RMW queues 920 are configured to write the address Hamming code andthe Hamming code of the data to memory. In response to read requests,the external memory interleave 220 and the RMW queues 920 are configuredto remove the address Hamming code by performing an exclusive ORoperation on the address Hamming code stored in the memory and theaddress Hamming code of the address identified in the read request.

Thus, the MSMC 200 supports various error detection and correctiontechniques. The MSMC 200 may support additional error correction anddetection techniques. For example, the coherency controller 224 maycalculate and store a parity bit for each snoop filter state identifiedin the snoop filter banks 212.

Referring to FIG. 18, a flowchart of a method 1800 of transmittingmessages on a shared interconnect is shown. The method 1800 may beperformed by an arbiter circuit, such as the arbiter circuit 260 of FIG.2. The method 1800 includes receiving a message from a first device of aplurality of devices connected to an interconnect, at 1802. Theplurality of devices includes a first interface connected to theinterconnect, a second interface connected to the interconnect, a firstmemory bank connected to the interconnect, a second memory bankconnected to the interconnect, and an external memory interfaceconnected to the interconnect. For example, the arbiter circuit 260 mayreceive a memory access request from one of the coherent slaveinterfaces 206 connected to the data path 262. The other coherent slaveinterfaces 206, the RAM banks 218, and the external memory masterinterfaces are connected to the data path 262.

The method 1800 further includes determining, at the controller, avirtual channel associated with a destination of the message, at 1804.For example, the arbiter circuit 260 may determine based on a memoryaddress identified in the memory access request (and a snoop filterstate associated with the memory address) an identity of a target of thememory access request. The arbiter circuit 260 may select a virtualchannel associated with the target.

The method 1800 further includes initiating, at the controller,transmission of the message and an identifier of the virtual channelover the interconnect, at 1806. For example, the arbiter circuit 260 mayadd an identifier of the virtual channel to the memory access requestand transmit the memory access request on the data path 262.

Thus, the method 1800 may be used by a circuit to provide virtualchannels over a shared data path.

Referring to FIG. 19, a flowchart of a method 1900 of arbitrating accessto a common data path is shown. The method 1900 includes receiving afirst memory access request from a first processor package connected toa first interface, at 1902. For example, the arbiter circuit 260 mayreceive a first memory access request from the first coherent slaveinterface 206A connected to the data path 262.

The method 1900 further includes receiving a second memory accessrequest from a second processor package connected to a second interface,at 1904. For example, the arbiter circuit 260 may receive a secondmemory access request from the eleventh coherent slave interface 206Bconnected to the data path 262.

The method 1900 further includes determining a first destination deviceassociated with the first memory access request and a first creditthreshold corresponding to the first memory access request, at 1906. Forexample, the arbiter circuit 260 may determine a destination device(e.g., one of the RMW queues 920 associated with the RAM banks 218)associated with the first memory access request based on an addressincluded in the first memory access request, a state of the data cacheprovided by the RAM banks 218, and a state of the snoop filter banks212. The arbiter circuit 260 may further determine a first creditthreshold corresponding to the first memory access request based on atype of the first memory access request. For example, read requests mayhave a credit cost (e.g., a credit threshold) of 2 credits while writerequests have a credit cost of 4 credits.

The method 1900 further includes determining a second destination deviceassociated with the second memory access request and a second creditthreshold corresponding to the second memory access request, at 1908.For example, the arbiter circuit 260 may determine a second destinationdevice (e.g., one of the RMW queues 920 associated with the RAM banks218) associated with the second memory access request based on anaddress included in the second memory access request, a state of thedata cache provided by the RAM banks 218, and a state of the snoopfilter banks 212. The arbiter circuit 260 may further determine a secondcredit threshold (e.g., credit cost) corresponding to the second memoryaccess request based on a type of the second memory access request.

The method 1900 further includes arbitrating access to a common datapath by the first memory access request and the second memory accessrequest based on a comparison of the first credit threshold to a firstnumber of credits allocated to the first destination device and acomparison of the second credit threshold to a second number of creditsallocated to the second destination device, at 1910. For example, thearbiter circuit 260 may compare the first credit threshold to a numberof credits available to the destination device of the first memoryaccess request and compare the second credit threshold to a number ofcredits available to the destination device of the second memory accessrequest. The arbiter circuit 260 may select a winner from among thememory access requests whose destination devices have a number ofcredits that satisfy the credit thresholds associated with the memoryaccess requests.

Referring to FIG. 20, a flowchart of a method 2000 of allocating waysbetween addressable memory space and a data cache is shown. The method2000 includes receiving, at a controller of a multi-core shared memorycontroller (MSMC), a configuration setting, at 2002. The MSMC includes amemory bank including data portions of a first way group. The dataportions of the first way group include a data portion of a first way ofthe first way group and a data portion of a second way of the first waygroup. The memory bank further includes data portions of a second waygroup. For example, the arbitration and data path manager 204 mayreceive a cache configuration setting from the cache configurationregister 1204. The MSMC 200 includes the RAM bank 218A that stores dataportions of a plurality of ways. The ways are arranged in groups (e.g.,sets), as shown in FIG. 16.

The method 2000 further includes allocating, at the controller, thefirst way and the second way to one of an addressable memory space and adata cache based on the configuration setting, at 2004. For example, asillustrated in FIG. 16, the arbitration and data path manager 204 mayindependently allocate ways within a way group between addressablememory space and a data cache.

Referring to FIG. 21, a method of protecting data within a memorycontroller is shown. The method 2100 includes receiving, at a controllerof a multi-core shared memory controller (MSMC), a request to write adata value to a memory address of an external memory device connected tothe MSMC, at 2102. For example, the arbiter circuit 260 may receive awrite request from the first coherent slave interface 206A.

The method 2100 further includes calculating, a Hamming code of the datavalue, at 2104. For example, the arbiter circuit 260 may calculate aHamming code of data included in the write request.

The method 2100 further includes transmitting the data value and theHamming code to an external memory interleave of the MSMC on a commondata path connected to components of the MSMC, at 2106. For example, thearbiter circuit 260 may transmit the data and the Hamming code to theexternal memory interleave 220 through the data path 262 (e.g., via oneof the RMW queues 920).

The method 2100 further includes determining, at the external memoryinterleave, a test Hamming code based on the data value. The methodfurther includes determining whether to send the data value to theexternal memory device based on a comparison of the test Hamming codeand the Hamming code, at 2108. For example, the external memoryinterleave 220 may calculate a test Hamming code for the data andcompare the test Hamming code with the Hamming code received with thedata. In response to determining that the Hamming code is equal to thetest Hamming code, the external memory interleave 220 may output thedata to the external memory master interfaces 222 for writing to anexternal memory device. In response to detecting a single bit error, theexternal memory interleave 220 may correct the single bit error in thedata based on a position of a difference in the test Hamming code andthe Hamming code. In response to detecting a multi-bit error, theexternal memory interleave 220 may return an error message to thearbiter circuit 260 to be output to the first coherent slave interface206A.

Thus, the method 2100 may be used to protect data transmitted within amemory interface.

Referring to FIG. 22, a flowchart of a method of performing two-steparbitration is shown. The method 2200 includes receiving, at anarbitration circuit, a first memory access request from a firstprocessor package connected to a first interface, at 2202. For example,the arbiter circuit 260 may receive a first memory access request fromthe first coherent slave interface 206A connected to the data path 262.

The method 2200 further includes receiving, at the arbitration circuit,a second memory access request from a second processor package connectedto a second interface, at 2204. For example, the arbiter circuit 260 mayreceive a second memory access request from the eleventh coherent slaveinterface 206B connected to the data path 262.

The method 2200 further includes, in a first clock cycle, determining,at the arbitration circuit, a first destination device associated withthe first memory access request and a first credit thresholdcorresponding to the first memory access request, at 2206. For example,in a first clock cycle, the arbiter circuit 260 may determine adestination device (e.g., one of the RMW queues 920 associated with theRAM banks 218) associated with the first memory access request based onan address included in the first memory access request, a state of thedata cache provided by the RAM banks 218, and a state of the snoopfilter banks 212. The arbiter circuit 260 may further determine a firstcredit threshold corresponding to the first memory access request basedon a type of the first memory access request. For example, read requestsmay have a credit cost (e.g., a credit threshold) of 2 credits whilewrite requests have a credit cost of 4 credits.

The method 2200 further includes, in the first clock cycle, determining,at the arbitration circuit, a second destination device associated withthe second memory access request and a second credit thresholdcorresponding to the second memory access request, at 2208. For example,in the first clock cycle, the arbiter circuit 260 may determine a seconddestination device (e.g., one of the RMW queues 920 associated with theRAM banks 218) associated with the second memory access request based onan address included in the second memory access request, a state of thedata cache provided by the RAM banks 218, and a state of the snoopfilter banks 212. The arbiter circuit 260 may further determine a secondcredit threshold (e.g., credit cost) corresponding to the second memoryaccess request based on a type of the second memory access request.

The method 2200 further includes, in the first clock cycle, selecting apre-arbitration winner between the first memory access request and thesecond memory access request based on a comparison of the first creditthreshold to a first number of credits allocated to the firstdestination device and a comparison of the second credit threshold to asecond number of credits allocated to the second destination device, at2210. For example, in the first clock cycle, the arbiter circuit 260 maycompare the first credit threshold to a number of credits available tothe destination device of the first memory access request and comparethe second credit threshold to a number of credits available to thedestination device of the second memory access request. The arbitercircuit 260 may select a pre-arbitration winner from among the memoryaccess requests whose destination devices have a number of credits thatsatisfy the credit thresholds associated with the memory accessrequests.

The method 2200 further includes, in a second clock cycle, selecting afinal arbitration winner from among the pre-arbitration winner and asubsequent memory access request based on a comparison of a priority ofthe pre-arbitration winner and a priority of the subsequent memoryaccess request and driving the final arbitration winner to the datapath, at 2212. For example, in a second clock cycle, the arbiter circuit260 may compare a priority of the pre-arbitration winner with a priorityof a subsequently received memory access request and select a finalarbitration winner. The arbiter circuit 260 may then drive the finalarbitration winner on the data path 262.

Thus, the method 2200 describes a method of multi-step arbitration. Themulti-step arbitration method may be used to pre-empt a pre-arbitrationwinner based on priority of a subsequently received request.

Referring to FIG. 23, a method 2300 of hiding credits during creditbased arbitration is shown. The method 2300 may be performed by thearbiter circuit 260 or any other arbitration device in a credit basedarbitration system. The method 2300 includes receiving a first requestfor a resource, at 2302. The first request is associated with a firstcredit cost. For example, the arbiter circuit 260 may receive a readrequest from the first coherent slave interface 206A. The arbitercircuit 260 may determine that the read request is to be transmitted tothe first RMW queue 902A (e.g., based on an address identified in theread request and data from the coherency controller 224). The readrequest may have a cost of two credits.

The method 2300 further includes receiving a second request for theresource, at 2304. The second request is associated with a second creditcost. For example, the arbiter circuit 260 may receive a read write fromthe eleventh coherent slave interface 206B. The arbiter circuit 260 maydetermine that the write request is to be transmitted to the first RMWqueue 902A (e.g., based on an address identified in the read request anddata from the coherency controller 224). The write request may have acost of four credits.

The method 2300 further includes selecting the first request for theresource as an arbitration winner, at 2306. For example, the arbitercircuit 260 may select the read request as the arbitration winner.

The method 2300 further includes decrementing a number of availablecredits associated with the resource by the first credit cost, at 2308.For example, the arbiter circuit 260 may decrement a number of availablecredits associated with the first RMW queue 902A from two credits tozero credits.

The method 2300 further includes in response to the number of availablecredits associated with the resource falling to a lower creditthreshold, waiting until the number of available credits associated withthe resource reaches an upper credit threshold to select an additionalarbitration winner for the resource, at 2310. For example, in responseto the number of available credits associated with the first RMW queue902A falling to zero credits, the arbiter circuit 260 may wait until thenumber of credits available credits associated with the first RMW queue902A reaches four credits before selecting a next arbitration winner tobe sent to the first RMW queue 902A.

Thus, the method 2300 may be used by an arbiter to hide credits for aresource until a number of credits available for the resource meets anupper threshold. This may prevent lower cost requests from monopolizingthe resource. In some implementations, the method 2300 includes settingthe upper credit threshold based on heuristics at each moment in time.For example, the arbiter circuit may scale the upper credit threshold toequal the credit cost of the currently arbitrating request with thehighest credit cost.

In this description, the term “couple” or “couples” means either anindirect or direct wired or wireless connection. Thus, if a first devicecouples to a second device, that connection may be through a directconnection or through an indirect connection via other devices andconnections. The recitation “based on” means “based at least in parton.” Therefore, if X is based on Y, X may be a function of Y and anynumber of other factors.

Modifications are possible in the described embodiments, and otherembodiments are possible, within the scope of the claims. While thespecific embodiments described above have been shown by way of example,it will be appreciated that many modifications and other embodimentswill come to the mind of one skilled in the art having the benefit ofthe teachings presented in the foregoing description and the associateddrawings. Accordingly, it is understood that various modifications andembodiments are intended to be included within the scope of the appendedclaims. For example, various methods and operations described herein maybe performed individually or in combination by devices other than thosedepicted.

What is claimed is:
 1. A device comprising: a snoop filter bank; a cachetag bank; and a memory bank, wherein the cache tag bank is connected toboth the snoop filter bank and the memory bank.
 2. The device of claim1, wherein the cache tag bank is configured to store an address tagindicating an address within a memory device, the snoop filter bank isconfigured to store a snoop state associated with the address tag, andthe memory bank is configured to store a cached value associated withthe address tag.
 3. The device of claim 2, further comprising aplurality of coherent slave interfaces, wherein the snoop stateindicates whether any of a plurality of peripheral devices connected tothe plurality of coherent slave interfaces store a local value for theaddress tag.
 4. The device of claim 3, wherein the snoop state includesa saturating vector identifying one of the plurality of peripheraldevices.
 5. The device of claim 3, further comprising a coherencycontroller configured to respond to requests, from the plurality ofperipheral devices, to access the memory bank, an external memorydevice, or a combination thereof based on data stored in the snoopfilter bank, the cache tag bank, and the memory bank.
 6. The device ofclaim 5, wherein the coherency controller is configured to promote aread request for shared access to a memory address to a read request forunique access to the memory address in response to a determination thatthe snoop filter bank indicates an invalid state for the memory address.7. The device of claim 5, further comprising a memory management unitconnected to the coherency controller, the memory management unitconfigured to store translations between virtual address spaces of theplurality of peripheral devices and physical address spaces of thememory bank and the external memory device.
 8. The device of claim 7,wherein the coherency controller is configured to, in response toreceiving a request to access a memory address, request a translation ofthe memory address from the memory management unit.
 9. The device ofclaim 1, further comprising: a second snoop filter bank; a second cachetag bank; and a second memory bank, wherein the second cache tag bank isconnected to both the second snoop filter bank and the second memorybank, and wherein the second snoop filter bank, the second cache tagbank, and the second memory bank are arranged in parallel with the snoopfilter bank, the cache tag bank, and the second memory bank.
 10. Asystem comprising: a multi-core shared memory controller including: asnoop filter bank; a cache tag bank; a memory bank, wherein the cachetag bank is connected to both the snoop filter bank and the memory bank;a first coherent slave interface connected to a data path that includesthe snoop filter bank; a second coherent slave interface connected tothe data path that includes the snoop filter bank; and an externalmemory master interface connected to the cache tag bank and the memorybank; a first processor package connected to the first coherent slaveinterface; a second processor package connected to the second coherentslave interface; and an external memory device connected to the externalmemory master interface.
 11. The system of claim 10, wherein the cachetag bank is configured to store an address tag indicating an addresswithin the external memory device, the snoop filter bank is configuredto store a snoop state associated with the address tag, and the memorybank is configured to store a cached value associated with the addresstag.
 12. The system of claim 11, wherein the snoop state indicateswhether either of a plurality of the first processor package or thesecond processor package stores a local value for the address tag. 13.The system of claim 12, wherein the snoop state includes a saturatingvector identifying one of the first processor package and the secondprocessor package.
 14. The system of claim 12, wherein the data pathincludes a coherency controller configured to respond to read and writerequests from the first processor package and the second processorpackage based on data stored in the snoop filter bank, the cache tagbank, and the memory bank.
 15. The system of claim 14, wherein thecoherency controller is configured to promote a read request for sharedaccess to a memory address to a read request for unique access to thememory address in response to a determination that the snoop filter bankindicates an invalid state for the memory address.
 16. The system ofclaim 14, wherein the multi-core shared memory controller furtherincludes a memory management unit connected to the data path, the memorymanagement unit configured to store translations between virtual addressspaces of the first processor package and the second processor packageand physical address spaces of the memory bank and the external memorydevice.
 17. The system of claim 16, wherein the coherency controller isconfigured to, in response to receiving a request to access a memoryaddress, request a translation of the memory address from the memorymanagement unit.
 18. The system of claim 10, further comprising, asecond snoop filter bank; a second cache tag bank; and a second memorybank, wherein the second cache tag bank is connected to both the secondsnoop filter bank and the second memory bank, and wherein the secondsnoop filter bank, the second cache tag bank, and the second memory bankare arranged in parallel with the snoop filter bank, the cache tag bank,and the second memory bank.
 19. A method comprising: receiving, at amulti-core shared memory controller (MSMC), a request from a peripheraldevice connected to the MSMC to access a memory address, the requestcorresponding to a read request or to a write request; applying, at theMSMC, a tag associated with the memory address to a cache tag bank ofthe MSMC to identify: a snoop filter state of the tag stored in a snoopfilter bank connected to the cache tag bank; and a cache hit status ofthe tag in a memory bank connected to the cache tag bank; anddetermining whether to issue a snoop request to a device connected tothe MSMC based on the snoop filter state and the cache hit status. 20.The method of claim 19, further comprising promoting the request to aread request for unique access to the memory address in response to therequest from the peripheral device corresponding to a read request forshared access to the memory address and a determination that the snoopfilter state of the tag associated with the memory address indicates aninvalid state for the tag.